Fixed footstep sounds
parent
b19e9fda43
commit
4bce675697
|
@ -74,10 +74,7 @@ namespace stardew_access.Game
|
||||||
{
|
{
|
||||||
toSpeak = "Ladder";
|
toSpeak = "Ladder";
|
||||||
}
|
}
|
||||||
else if (!Game1.currentLocation.isTilePassable(Game1.player.nextPosition(Game1.player.getDirection()), Game1.viewport))
|
else
|
||||||
{
|
|
||||||
toSpeak = "Colliding";
|
|
||||||
} else
|
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -247,6 +244,9 @@ namespace stardew_access.Game
|
||||||
else if(stage >= 4)
|
else if(stage >= 4)
|
||||||
toReturn = $"{toReturn} tree";
|
toReturn = $"{toReturn} tree";
|
||||||
|
|
||||||
|
if (fruitTree.fruitsOnTree.Value > 0)
|
||||||
|
toReturn = $"Harvestable {toReturn}";
|
||||||
|
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -347,6 +347,48 @@ namespace stardew_access.Game
|
||||||
return "Ice crystal";
|
return "Ice crystal";
|
||||||
case 75:
|
case 75:
|
||||||
return "Geode";
|
return "Geode";
|
||||||
|
case 32:
|
||||||
|
case 34:
|
||||||
|
case 36:
|
||||||
|
case 38:
|
||||||
|
case 40:
|
||||||
|
case 42:
|
||||||
|
case 48:
|
||||||
|
case 50:
|
||||||
|
case 52:
|
||||||
|
case 54:
|
||||||
|
case 56:
|
||||||
|
case 58:
|
||||||
|
return "Coloured stone";
|
||||||
|
case 668:
|
||||||
|
case 670:
|
||||||
|
case 845:
|
||||||
|
case 846:
|
||||||
|
case 847:
|
||||||
|
return "Mine stone";
|
||||||
|
case 818:
|
||||||
|
return "Clay stone";
|
||||||
|
case 816:
|
||||||
|
case 817:
|
||||||
|
return "Fossil stone";
|
||||||
|
case 25:
|
||||||
|
return "Stone";
|
||||||
|
case 118:
|
||||||
|
case 120:
|
||||||
|
case 122:
|
||||||
|
case 124:
|
||||||
|
return "Barrel";
|
||||||
|
case 119:
|
||||||
|
case 121:
|
||||||
|
case 123:
|
||||||
|
case 125:
|
||||||
|
return "Item box";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Game1.inMine || Game1.currentLocation is Mine)
|
||||||
|
{
|
||||||
|
switch (index)
|
||||||
|
{
|
||||||
case 76:
|
case 76:
|
||||||
return "Frozen geode";
|
return "Frozen geode";
|
||||||
case 77:
|
case 77:
|
||||||
|
@ -393,42 +435,7 @@ namespace stardew_access.Game
|
||||||
case 290:
|
case 290:
|
||||||
case 850:
|
case 850:
|
||||||
return "Iron node";
|
return "Iron node";
|
||||||
case 32:
|
}
|
||||||
case 34:
|
|
||||||
case 36:
|
|
||||||
case 38:
|
|
||||||
case 40:
|
|
||||||
case 42:
|
|
||||||
case 48:
|
|
||||||
case 50:
|
|
||||||
case 52:
|
|
||||||
case 54:
|
|
||||||
case 56:
|
|
||||||
case 58:
|
|
||||||
return "Coloured stone";
|
|
||||||
case 668:
|
|
||||||
case 670:
|
|
||||||
case 845:
|
|
||||||
case 846:
|
|
||||||
case 847:
|
|
||||||
return "Mine stone";
|
|
||||||
case 818:
|
|
||||||
return "Clay stone";
|
|
||||||
case 816:
|
|
||||||
case 817:
|
|
||||||
return "Fossil stone";
|
|
||||||
case 25:
|
|
||||||
return "Stone";
|
|
||||||
case 118:
|
|
||||||
case 120:
|
|
||||||
case 122:
|
|
||||||
case 124:
|
|
||||||
return "Barrel";
|
|
||||||
case 119:
|
|
||||||
case 121:
|
|
||||||
case 123:
|
|
||||||
case 125:
|
|
||||||
return "Item box";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return toReturn;
|
return toReturn;
|
||||||
|
|
|
@ -172,11 +172,6 @@ namespace stardew_access
|
||||||
original: AccessTools.Method(typeof(LanguageSelectionMenu), nameof(LanguageSelectionMenu.draw), new Type[] { typeof(SpriteBatch) }),
|
original: AccessTools.Method(typeof(LanguageSelectionMenu), nameof(LanguageSelectionMenu.draw), new Type[] { typeof(SpriteBatch) }),
|
||||||
postfix: new HarmonyMethod(typeof(MenuPatches), nameof(MenuPatches.LanguageSelectionMenuPatch))
|
postfix: new HarmonyMethod(typeof(MenuPatches), nameof(MenuPatches.LanguageSelectionMenuPatch))
|
||||||
);
|
);
|
||||||
|
|
||||||
/*harmony.Patch(
|
|
||||||
original: AccessTools.Method(typeof(HUDMessage), nameof(HUDMessage.draw), new Type[] { typeof(SpriteBatch), typeof(int) }),
|
|
||||||
postfix: new HarmonyMethod(typeof(MenuPatches), nameof(MenuPatches.HUDMessagePatch))
|
|
||||||
);*/
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Quest Patches
|
#region Quest Patches
|
||||||
|
@ -214,6 +209,11 @@ namespace stardew_access
|
||||||
);
|
);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
harmony.Patch(
|
||||||
|
original: AccessTools.Method(typeof(Game1), nameof(Game1.playSound)),
|
||||||
|
prefix: new HarmonyMethod(typeof(MenuPatches), nameof(MenuPatches.PlaySoundPatch))
|
||||||
|
);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Custom Commands
|
#region Custom Commands
|
||||||
|
@ -388,7 +388,7 @@ namespace stardew_access
|
||||||
MainClass.monitor.Log($"Unable to narrate hud messages:\n{e.Message}\n{e.StackTrace}", LogLevel.Error);
|
MainClass.monitor.Log($"Unable to narrate hud messages:\n{e.Message}\n{e.StackTrace}", LogLevel.Error);
|
||||||
}
|
}
|
||||||
|
|
||||||
await Task.Delay(1000);
|
await Task.Delay(300);
|
||||||
isNarratingHudMessage = false;
|
isNarratingHudMessage = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
using StardewModdingAPI;
|
using Microsoft.Xna.Framework;
|
||||||
|
using stardew_access.Game;
|
||||||
|
using StardewModdingAPI;
|
||||||
using StardewValley;
|
using StardewValley;
|
||||||
using StardewValley.Menus;
|
using StardewValley.Menus;
|
||||||
|
using StardewValley.TerrainFeatures;
|
||||||
|
|
||||||
namespace stardew_access.Patches
|
namespace stardew_access.Patches
|
||||||
{
|
{
|
||||||
|
@ -9,6 +12,51 @@ namespace stardew_access.Patches
|
||||||
private static string currentLetterText = " ";
|
private static string currentLetterText = " ";
|
||||||
private static string currentLevelUpTitle = " ";
|
private static string currentLevelUpTitle = " ";
|
||||||
|
|
||||||
|
internal static bool PlaySoundPatch(string cueName)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (!Context.IsPlayerFree)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if(!Game1.player.isMoving())
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if(cueName == "grassyStep" || cueName == "sandyStep" || cueName == "snowyStep" || cueName == "stoneStep" || cueName == "thudStep" || cueName == "woodyStep")
|
||||||
|
{
|
||||||
|
if(!Game1.currentLocation.isTilePassable(Game1.player.nextPosition(Game1.player.getDirection()), Game1.viewport))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Check for objects
|
||||||
|
Vector2 gt = CurrentPlayer.getNextTile();
|
||||||
|
|
||||||
|
if (Game1.currentLocation.isObjectAtTile((int)gt.X, (int)gt.Y))
|
||||||
|
{
|
||||||
|
if (!Game1.currentLocation.getObjectAtTile((int)gt.X, (int)gt.Y).isPassable())
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Check for terrain features
|
||||||
|
Dictionary<Vector2, Netcode.NetRef<TerrainFeature>> terrainFeature = Game1.currentLocation.terrainFeatures.FieldDict;
|
||||||
|
if (terrainFeature.ContainsKey(gt))
|
||||||
|
{
|
||||||
|
if (!terrainFeature[gt].Get().isPassable())
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
MainClass.monitor.Log($"Unable to narrate Text:\n{e.Message}\n{e.StackTrace}", LogLevel.Error);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
internal static void LanguageSelectionMenuPatch(LanguageSelectionMenu __instance)
|
internal static void LanguageSelectionMenuPatch(LanguageSelectionMenu __instance)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
Loading…
Reference in New Issue