Compare commits
No commits in common. "e50f0fa9761e1e8f858716b2813278bd17240de1" and "02250ed307d96c44afc4e8c91759494aba027e8e" have entirely different histories.
e50f0fa976
...
02250ed307
|
@ -356,7 +356,7 @@ namespace stardew_access
|
||||||
|
|
||||||
helper.ConsoleCommands.Add("buildsel", "Select the building index which you want to upgrade/demolish/paint", (string command, string[] args) =>
|
helper.ConsoleCommands.Add("buildsel", "Select the building index which you want to upgrade/demolish/paint", (string command, string[] args) =>
|
||||||
{
|
{
|
||||||
if ((Game1.activeClickableMenu is not CarpenterMenu && Game1.activeClickableMenu is not PurchaseAnimalsMenu && Game1.activeClickableMenu is not AnimalQueryMenu) || (!CarpenterMenuPatch.isOnFarm && !PurchaseAnimalsMenuPatch.isOnFarm && !AnimalQueryMenuPatch.isOnFarm))
|
if ((Game1.activeClickableMenu is not CarpenterMenu && Game1.activeClickableMenu is not PurchaseAnimalsMenu && Game1.activeClickableMenu is not AnimalQueryMenu) || !CarpenterMenuPatch.isOnFarm)
|
||||||
{
|
{
|
||||||
MainClass.InfoLog($"Cannot select building.");
|
MainClass.InfoLog($"Cannot select building.");
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -24,6 +24,9 @@ namespace stardew_access
|
||||||
soundEffects.Add("colliding", TYPE.Sound);
|
soundEffects.Add("colliding", TYPE.Sound);
|
||||||
soundEffects.Add("invalid-selection", TYPE.Sound);
|
soundEffects.Add("invalid-selection", TYPE.Sound);
|
||||||
|
|
||||||
|
soundEffects.Add("bobber_target_up", TYPE.Sound);
|
||||||
|
soundEffects.Add("bobber_target_down", TYPE.Sound);
|
||||||
|
|
||||||
soundEffects.Add("npc_top", TYPE.Footstep);
|
soundEffects.Add("npc_top", TYPE.Footstep);
|
||||||
soundEffects.Add("npc_right", TYPE.Footstep);
|
soundEffects.Add("npc_right", TYPE.Footstep);
|
||||||
soundEffects.Add("npc_left", TYPE.Footstep);
|
soundEffects.Add("npc_left", TYPE.Footstep);
|
||||||
|
|
|
@ -4,7 +4,6 @@ using Microsoft.Xna.Framework.Graphics;
|
||||||
using Microsoft.Xna.Framework.Input;
|
using Microsoft.Xna.Framework.Input;
|
||||||
using stardew_access.Patches;
|
using stardew_access.Patches;
|
||||||
using StardewValley;
|
using StardewValley;
|
||||||
using StardewValley.Characters;
|
|
||||||
using StardewValley.Menus;
|
using StardewValley.Menus;
|
||||||
using StardewValley.Minigames;
|
using StardewValley.Minigames;
|
||||||
|
|
||||||
|
@ -276,6 +275,12 @@ namespace stardew_access
|
||||||
original: AccessTools.Method(typeof(GrandpaStory), nameof(GrandpaStory.draw), new Type[] { typeof(SpriteBatch) }),
|
original: AccessTools.Method(typeof(GrandpaStory), nameof(GrandpaStory.draw), new Type[] { typeof(SpriteBatch) }),
|
||||||
postfix: new HarmonyMethod(typeof(GrandpaStoryPatch), nameof(GrandpaStoryPatch.DrawPatch))
|
postfix: new HarmonyMethod(typeof(GrandpaStoryPatch), nameof(GrandpaStoryPatch.DrawPatch))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
harmony.Patch(
|
||||||
|
original: AccessTools.Method(typeof(BobberBar), nameof(BobberBar.update)),
|
||||||
|
postfix: new HarmonyMethod(typeof(FishingMiniGamePatch), nameof(FishingMiniGamePatch.BobberBarPatch))
|
||||||
|
);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
harmony.Patch(
|
harmony.Patch(
|
||||||
|
@ -292,26 +297,6 @@ namespace stardew_access
|
||||||
original: AccessTools.Method(typeof(TextBox), nameof(TextBox.Draw)),
|
original: AccessTools.Method(typeof(TextBox), nameof(TextBox.Draw)),
|
||||||
prefix: new HarmonyMethod(typeof(TextBoxPatch), nameof(TextBoxPatch.DrawPatch))
|
prefix: new HarmonyMethod(typeof(TextBoxPatch), nameof(TextBoxPatch.DrawPatch))
|
||||||
);
|
);
|
||||||
|
|
||||||
harmony.Patch(
|
|
||||||
original: AccessTools.Method(typeof(TextEntryMenu), nameof(TextEntryMenu.draw), new Type[] { typeof(SpriteBatch) }),
|
|
||||||
prefix: new HarmonyMethod(typeof(TextEntryMenuPatch), nameof(TextEntryMenuPatch.DrawPatch))
|
|
||||||
);
|
|
||||||
|
|
||||||
harmony.Patch(
|
|
||||||
original: AccessTools.Method(typeof(TextEntryMenu), nameof(TextEntryMenu.Close)),
|
|
||||||
prefix: new HarmonyMethod(typeof(TextEntryMenuPatch), nameof(TextEntryMenuPatch.ClosePatch))
|
|
||||||
);
|
|
||||||
|
|
||||||
harmony.Patch(
|
|
||||||
original: AccessTools.Method(typeof(Game1), nameof(Game1.closeTextEntry)),
|
|
||||||
prefix: new HarmonyMethod(typeof(Game1Patch), nameof(Game1Patch.CloseTextEntryPatch))
|
|
||||||
);
|
|
||||||
|
|
||||||
harmony.Patch(
|
|
||||||
original: AccessTools.Method(typeof(TrashBear), nameof(TrashBear.checkAction)),
|
|
||||||
postfix: new HarmonyMethod(typeof(TrashBearPatch), nameof(TrashBearPatch.CheckActionPatch))
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,6 +89,9 @@ namespace stardew_access
|
||||||
public Boolean DisableInventoryVerbosity {get; set;} = false; // If enabled, does not speaks 'not usable here' and 'donatable' in inventories
|
public Boolean DisableInventoryVerbosity {get; set;} = false; // If enabled, does not speaks 'not usable here' and 'donatable' in inventories
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
public int MaximumFishingDifficulty { get; set; } = 999; // TODO Add doc
|
||||||
|
public int FixFishingMotionType { get; set; } = 999;
|
||||||
|
|
||||||
// TODO Add the exclusion and focus list too
|
// TODO Add the exclusion and focus list too
|
||||||
// public String ExclusionList { get; set; } = "test";
|
// public String ExclusionList { get; set; } = "test";
|
||||||
}
|
}
|
||||||
|
|
|
@ -129,21 +129,10 @@ namespace stardew_access
|
||||||
helper.Events.Input.ButtonPressed += this.OnButtonPressed;
|
helper.Events.Input.ButtonPressed += this.OnButtonPressed;
|
||||||
helper.Events.GameLoop.UpdateTicked += this.onUpdateTicked;
|
helper.Events.GameLoop.UpdateTicked += this.onUpdateTicked;
|
||||||
helper.Events.GameLoop.DayStarted += this.onDayStarted;
|
helper.Events.GameLoop.DayStarted += this.onDayStarted;
|
||||||
helper.Events.Display.MenuChanged += this.onMenuChanged;
|
|
||||||
AppDomain.CurrentDomain.DomainUnload += OnExit;
|
AppDomain.CurrentDomain.DomainUnload += OnExit;
|
||||||
AppDomain.CurrentDomain.ProcessExit += OnExit;
|
AppDomain.CurrentDomain.ProcessExit += OnExit;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onMenuChanged(object? sender, MenuChangedEventArgs e)
|
|
||||||
{
|
|
||||||
TextBoxPatch.activeTextBoxes = "";
|
|
||||||
if (e.OldMenu != null)
|
|
||||||
{
|
|
||||||
MainClass.DebugLog($"Switched from {e.OldMenu.GetType().ToString()} menu, performing cleanup...");
|
|
||||||
IClickableMenuPatch.Cleanup(e.OldMenu);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Returns the Screen Reader class for other mods to use.</summary>
|
/// <summary>Returns the Screen Reader class for other mods to use.</summary>
|
||||||
public override object GetApi()
|
public override object GetApi()
|
||||||
{
|
{
|
||||||
|
@ -346,20 +335,6 @@ namespace stardew_access
|
||||||
TileViewerFeature.HandleInput();
|
TileViewerFeature.HandleInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string Translate(string translationKey)
|
|
||||||
{
|
|
||||||
if (ModHelper == null) return "null";
|
|
||||||
|
|
||||||
return ModHelper.Translation.Get(translationKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string Translate(string translationKey, object? tokens)
|
|
||||||
{
|
|
||||||
if (ModHelper == null) return "null";
|
|
||||||
|
|
||||||
return ModHelper.Translation.Get(translationKey, tokens);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void LogMessage(string message, LogLevel logLevel)
|
private static void LogMessage(string message, LogLevel logLevel)
|
||||||
{
|
{
|
||||||
if (monitor == null)
|
if (monitor == null)
|
||||||
|
|
|
@ -0,0 +1,77 @@
|
||||||
|
using StardewValley;
|
||||||
|
using StardewValley.Menus;
|
||||||
|
|
||||||
|
namespace stardew_access.Patches {
|
||||||
|
internal class FishingMiniGamePatch {
|
||||||
|
private static ICue? progressSound = null;
|
||||||
|
private static long previousBobberTargetUpPlayedTime = 0;
|
||||||
|
private static long previousBobberTargetDownPlayedTime = 0;
|
||||||
|
|
||||||
|
internal static void BobberBarPatch(BobberBar __instance, ref float ___difficulty, ref int ___motionType, float ___distanceFromCatching, float ___bobberPosition, float ___bobberBarPos, bool ___bobberInBar, int ___bobberBarHeight, bool ___fadeOut, bool ___fadeIn) {
|
||||||
|
try {
|
||||||
|
if (___difficulty > MainClass.Config.MaximumFishingDifficulty) {
|
||||||
|
MainClass.DebugLog($"Fish difficulty set to {MainClass.Config.MaximumFishingDifficulty} from {___difficulty}");
|
||||||
|
___difficulty = MainClass.Config.MaximumFishingDifficulty;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (___motionType != MainClass.Config.FixFishingMotionType &&
|
||||||
|
(MainClass.Config.FixFishingMotionType >= 0 && MainClass.Config.FixFishingMotionType <= 4)) {
|
||||||
|
MainClass.DebugLog($"Motion type set to {MainClass.Config.FixFishingMotionType} from {___motionType}");
|
||||||
|
___motionType = MainClass.Config.FixFishingMotionType;
|
||||||
|
}
|
||||||
|
|
||||||
|
handleProgressBarSound(___distanceFromCatching, ___fadeOut, ___fadeIn);
|
||||||
|
|
||||||
|
handleBobberTargetSound(___bobberPosition, ___bobberBarPos, ___bobberInBar, ___bobberBarHeight, ___fadeOut, ___fadeIn);
|
||||||
|
} catch (System.Exception e) {
|
||||||
|
MainClass.ErrorLog($"An error occured while patching bobber bar:\n{e.Message}\n{e.StackTrace}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void handleBobberTargetSound(float bobberPosition, float bobberBarPos, bool bobberInBar, int ___bobberBarHeight, bool ___fadeOut, bool ___fadeIn) {
|
||||||
|
if (bobberInBar) return;
|
||||||
|
if (___fadeIn) return;
|
||||||
|
if (___fadeOut) return;
|
||||||
|
|
||||||
|
DateTimeOffset now = (DateTimeOffset)DateTime.UtcNow;
|
||||||
|
long currentTimeInMilliseconds = now.ToUnixTimeMilliseconds();
|
||||||
|
|
||||||
|
if(bobberPosition < bobberBarPos && (currentTimeInMilliseconds - previousBobberTargetUpPlayedTime) >= 250) {
|
||||||
|
previousBobberTargetUpPlayedTime = currentTimeInMilliseconds;
|
||||||
|
int distanceFromBobber = (int)(bobberBarPos - bobberPosition + (___bobberBarHeight / 2));
|
||||||
|
int calculatedPitch = distanceFromBobber * 4;
|
||||||
|
MainClass.DebugLog(calculatedPitch.ToString());
|
||||||
|
Game1.playSoundPitched("bobber_target_up", calculatedPitch);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(bobberPosition > bobberBarPos && (currentTimeInMilliseconds - previousBobberTargetDownPlayedTime) >= 250) {
|
||||||
|
previousBobberTargetDownPlayedTime = currentTimeInMilliseconds;
|
||||||
|
int distanceFromBobber = (int)(bobberPosition - bobberBarPos - (___bobberBarHeight / 2));
|
||||||
|
int calculatedPitch = distanceFromBobber * 4;
|
||||||
|
MainClass.DebugLog(calculatedPitch.ToString());
|
||||||
|
Game1.playSoundPitched("bobber_target_down", calculatedPitch);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void handleProgressBarSound(float ___distanceFromCatching, bool ___fadeOut, bool ___fadeIn) {
|
||||||
|
if (Game1.soundBank == null) return;
|
||||||
|
|
||||||
|
if (progressSound == null) {
|
||||||
|
progressSound = Game1.soundBank.GetCue("SinWave");
|
||||||
|
}
|
||||||
|
|
||||||
|
progressSound.SetVariable("Pitch", 2400f * ___distanceFromCatching);
|
||||||
|
// progressSound.SetVariable("Volume", 300f);
|
||||||
|
|
||||||
|
if (___fadeIn && !progressSound.IsPlaying) {
|
||||||
|
// Start playing the sound on menu open
|
||||||
|
progressSound.Play();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (___fadeOut && progressSound.IsPlaying) {
|
||||||
|
// Stop playing the sound on menu close
|
||||||
|
progressSound.Stop(Microsoft.Xna.Framework.Audio.AudioStopOptions.Immediate);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -13,7 +13,6 @@ namespace stardew_access.Patches
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
MainClass.DebugLog($"Closing {Game1.activeClickableMenu.GetType().ToString()} menu, performing cleanup...");
|
|
||||||
IClickableMenuPatch.Cleanup(Game1.activeClickableMenu);
|
IClickableMenuPatch.Cleanup(Game1.activeClickableMenu);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
@ -22,11 +21,6 @@ namespace stardew_access.Patches
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static void CloseTextEntryPatch()
|
|
||||||
{
|
|
||||||
TextBoxPatch.activeTextBoxes = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
internal static bool PlaySoundPatch(string cueName)
|
internal static bool PlaySoundPatch(string cueName)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
|
@ -199,7 +199,6 @@ namespace stardew_access.Patches
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
MainClass.DebugLog($"Closed {__instance.GetType().ToString()} menu, performing cleanup...");
|
|
||||||
Cleanup(__instance);
|
Cleanup(__instance);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
@ -210,88 +209,114 @@ namespace stardew_access.Patches
|
||||||
|
|
||||||
internal static void Cleanup(IClickableMenu menu)
|
internal static void Cleanup(IClickableMenu menu)
|
||||||
{
|
{
|
||||||
switch (menu)
|
if (menu is TitleMenu)
|
||||||
{
|
{
|
||||||
case TitleMenu:
|
|
||||||
TitleMenuPatch.Cleanup();
|
TitleMenuPatch.Cleanup();
|
||||||
break;
|
}
|
||||||
case CoopMenu:
|
else if (menu is CoopMenu)
|
||||||
|
{
|
||||||
CoopMenuPatch.Cleanup();
|
CoopMenuPatch.Cleanup();
|
||||||
break;
|
}
|
||||||
case LoadGameMenu:
|
else if (menu is LoadGameMenu)
|
||||||
|
{
|
||||||
LoadGameMenuPatch.Cleanup();
|
LoadGameMenuPatch.Cleanup();
|
||||||
break;
|
}
|
||||||
case AdvancedGameOptions:
|
else if (menu is AdvancedGameOptions)
|
||||||
|
{
|
||||||
AdvancedGameOptionsPatch.Cleanup();
|
AdvancedGameOptionsPatch.Cleanup();
|
||||||
break;
|
}
|
||||||
case LetterViewerMenu:
|
else if (menu is LetterViewerMenu)
|
||||||
|
{
|
||||||
LetterViwerMenuPatch.Cleanup();
|
LetterViwerMenuPatch.Cleanup();
|
||||||
break;
|
}
|
||||||
case LevelUpMenu:
|
else if (menu is LevelUpMenu)
|
||||||
|
{
|
||||||
LevelUpMenuPatch.Cleanup();
|
LevelUpMenuPatch.Cleanup();
|
||||||
break;
|
}
|
||||||
case Billboard:
|
else if (menu is Billboard)
|
||||||
|
{
|
||||||
BillboardPatch.Cleanup();
|
BillboardPatch.Cleanup();
|
||||||
break;
|
}
|
||||||
case GameMenu:
|
else if (menu is GameMenu)
|
||||||
|
{
|
||||||
GameMenuPatch.Cleanup();
|
GameMenuPatch.Cleanup();
|
||||||
ExitPagePatch.Cleanup();
|
ExitPagePatch.Cleanup();
|
||||||
OptionsPagePatch.Cleanup();
|
OptionsPagePatch.Cleanup();
|
||||||
SocialPagePatch.Cleanup();
|
SocialPagePatch.Cleanup();
|
||||||
InventoryPagePatch.Cleanup();
|
InventoryPagePatch.Cleanup();
|
||||||
CraftingPagePatch.Cleanup();
|
CraftingPagePatch.Cleanup();
|
||||||
break;
|
}
|
||||||
case JunimoNoteMenu:
|
else if (menu is JunimoNoteMenu)
|
||||||
|
{
|
||||||
JunimoNoteMenuPatch.Cleanup();
|
JunimoNoteMenuPatch.Cleanup();
|
||||||
break;
|
}
|
||||||
case ShopMenu:
|
else if (menu is ShopMenu)
|
||||||
|
{
|
||||||
ShopMenuPatch.Cleanup();
|
ShopMenuPatch.Cleanup();
|
||||||
break;
|
}
|
||||||
case ItemGrabMenu:
|
else if (menu is ItemGrabMenu)
|
||||||
|
{
|
||||||
ItemGrabMenuPatch.Cleanup();
|
ItemGrabMenuPatch.Cleanup();
|
||||||
break;
|
}
|
||||||
case GeodeMenu:
|
else if (menu is GeodeMenu)
|
||||||
|
{
|
||||||
GeodeMenuPatch.Cleanup();
|
GeodeMenuPatch.Cleanup();
|
||||||
break;
|
}
|
||||||
case CarpenterMenu:
|
else if (menu is CarpenterMenu)
|
||||||
|
{
|
||||||
CarpenterMenuPatch.Cleanup();
|
CarpenterMenuPatch.Cleanup();
|
||||||
break;
|
}
|
||||||
case PurchaseAnimalsMenu:
|
else if (menu is PurchaseAnimalsMenu)
|
||||||
|
{
|
||||||
PurchaseAnimalsMenuPatch.Cleanup();
|
PurchaseAnimalsMenuPatch.Cleanup();
|
||||||
break;
|
}
|
||||||
case AnimalQueryMenu:
|
else if (menu is AnimalQueryMenu)
|
||||||
|
{
|
||||||
AnimalQueryMenuPatch.Cleanup();
|
AnimalQueryMenuPatch.Cleanup();
|
||||||
break;
|
}
|
||||||
case DialogueBox:
|
else if (menu is DialogueBox)
|
||||||
|
{
|
||||||
DialogueBoxPatch.Cleanup();
|
DialogueBoxPatch.Cleanup();
|
||||||
break;
|
}
|
||||||
case JojaCDMenu:
|
else if (menu is JojaCDMenu)
|
||||||
|
{
|
||||||
JojaCDMenuPatch.Cleanup();
|
JojaCDMenuPatch.Cleanup();
|
||||||
break;
|
}
|
||||||
case QuestLog:
|
else if (menu is QuestLog)
|
||||||
|
{
|
||||||
QuestLogPatch.Cleaup();
|
QuestLogPatch.Cleaup();
|
||||||
break;
|
}
|
||||||
case TailoringMenu:
|
else if (menu is TailoringMenu)
|
||||||
|
{
|
||||||
TailoringMenuPatch.Cleanup();
|
TailoringMenuPatch.Cleanup();
|
||||||
break;
|
}
|
||||||
case ForgeMenu:
|
else if (menu is ForgeMenu)
|
||||||
|
{
|
||||||
ForgeMenuPatch.Cleanup();
|
ForgeMenuPatch.Cleanup();
|
||||||
break;
|
}
|
||||||
case ItemListMenu:
|
else if (menu is ItemListMenu)
|
||||||
|
{
|
||||||
ItemListMenuPatch.Cleanup();
|
ItemListMenuPatch.Cleanup();
|
||||||
break;
|
}
|
||||||
case FieldOfficeMenu:
|
else if (menu is FieldOfficeMenu)
|
||||||
|
{
|
||||||
FieldOfficeMenuPatch.Cleanup();
|
FieldOfficeMenuPatch.Cleanup();
|
||||||
break;
|
}
|
||||||
case MuseumMenu:
|
else if (menu is MuseumMenu)
|
||||||
|
{
|
||||||
MuseumMenuPatch.Cleanup();
|
MuseumMenuPatch.Cleanup();
|
||||||
break;
|
}
|
||||||
case PondQueryMenu:
|
else if (menu is PondQueryMenu)
|
||||||
|
{
|
||||||
PondQueryMenuPatch.Cleanup();
|
PondQueryMenuPatch.Cleanup();
|
||||||
break;
|
}
|
||||||
case SpecialOrdersBoard:
|
else if (menu is GeodeMenu)
|
||||||
|
{
|
||||||
|
GeodeMenuPatch.Cleanup();
|
||||||
|
}
|
||||||
|
else if (menu is SpecialOrdersBoard)
|
||||||
|
{
|
||||||
SpecialOrdersBoardPatch.Cleanup();
|
SpecialOrdersBoardPatch.Cleanup();
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
InventoryUtils.Cleanup();
|
InventoryUtils.Cleanup();
|
||||||
|
|
|
@ -24,7 +24,6 @@ namespace stardew_access.Patches
|
||||||
|
|
||||||
if (isEscPressed)
|
if (isEscPressed)
|
||||||
{
|
{
|
||||||
if (activeTextBoxes.Contains(uniqueIdentifier)) activeTextBoxes = activeTextBoxes.Replace(uniqueIdentifier, "");
|
|
||||||
__instance.Selected = false;
|
__instance.Selected = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
|
|
||||||
namespace stardew_access.Patches
|
|
||||||
{
|
|
||||||
internal class TextEntryMenuPatch
|
|
||||||
{
|
|
||||||
internal static void DrawPatch(StardewValley.Menus.TextEntryMenu __instance, StardewValley.Menus.TextBox ____target)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
TextBoxPatch.DrawPatch(____target);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
MainClass.ErrorLog($"An error occured in DrawPatch() in TextEntryPatch:\n{e.Message}\n{e.StackTrace}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
internal static void ClosePatch()
|
|
||||||
{
|
|
||||||
TextBoxPatch.activeTextBoxes = "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,24 +0,0 @@
|
||||||
using StardewValley;
|
|
||||||
using StardewValley.Characters;
|
|
||||||
|
|
||||||
namespace stardew_access.Patches
|
|
||||||
{
|
|
||||||
internal class TrashBearPatch
|
|
||||||
{
|
|
||||||
internal static void CheckActionPatch(TrashBear __instance, bool __result, int ___itemWantedIndex, int ___showWantBubbleTimer)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (__result) return; // The true `true` value of __result indicates the bear is interactable i.e. when giving the bear the wanted item
|
|
||||||
if (__instance.sprite.Value.CurrentAnimation != null) return;
|
|
||||||
|
|
||||||
string itemName = Game1.objectInformation[___itemWantedIndex].Split('/')[4];
|
|
||||||
MainClass.ScreenReader.Say(MainClass.Translate("patch.trash_bear.wanted_item", new {trash_bear_name = __instance.displayName, item_name = itemName}), true);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
MainClass.ErrorLog($"An error occured TrashBearPatch::CheckActionPatch():\n{e.Message}\n{e.StackTrace}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -11,9 +11,7 @@ namespace stardew_access.Patches
|
||||||
internal static FarmAnimal? animalBeingMoved = null;
|
internal static FarmAnimal? animalBeingMoved = null;
|
||||||
internal static bool isOnFarm = false;
|
internal static bool isOnFarm = false;
|
||||||
|
|
||||||
private static double loveLevel;
|
internal static void DrawPatch(AnimalQueryMenu __instance, bool ___confirmingSell, FarmAnimal ___animal, TextBox ___textBox, string ___parentName, bool ___movingAnimal)
|
||||||
|
|
||||||
internal static void DrawPatch(AnimalQueryMenu __instance, bool ___confirmingSell, FarmAnimal ___animal, TextBox ___textBox, string ___parentName, bool ___movingAnimal, double ___loveLevel)
|
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -25,8 +23,6 @@ namespace stardew_access.Patches
|
||||||
animalQueryMenu = __instance;
|
animalQueryMenu = __instance;
|
||||||
animalBeingMoved = ___animal;
|
animalBeingMoved = ___animal;
|
||||||
|
|
||||||
loveLevel = ___loveLevel;
|
|
||||||
|
|
||||||
narrateAnimalDetailsOnKeyPress(___animal, ___parentName);
|
narrateAnimalDetailsOnKeyPress(___animal, ___parentName);
|
||||||
|
|
||||||
narrateHoveredButton(__instance, ___animal, ___confirmingSell, x, y);
|
narrateHoveredButton(__instance, ___animal, ___confirmingSell, x, y);
|
||||||
|
@ -48,7 +44,6 @@ namespace stardew_access.Patches
|
||||||
int age = (___animal.GetDaysOwned() + 1) / 28 + 1;
|
int age = (___animal.GetDaysOwned() + 1) / 28 + 1;
|
||||||
string ageText = (age <= 1) ? Game1.content.LoadString("Strings\\UI:AnimalQuery_Age1") : Game1.content.LoadString("Strings\\UI:AnimalQuery_AgeN", age);
|
string ageText = (age <= 1) ? Game1.content.LoadString("Strings\\UI:AnimalQuery_Age1") : Game1.content.LoadString("Strings\\UI:AnimalQuery_AgeN", age);
|
||||||
string parent = "";
|
string parent = "";
|
||||||
|
|
||||||
if ((int)___animal.age.Value < (byte)___animal.ageWhenMature.Value)
|
if ((int)___animal.age.Value < (byte)___animal.ageWhenMature.Value)
|
||||||
{
|
{
|
||||||
ageText += Game1.content.LoadString("Strings\\UI:AnimalQuery_AgeBaby");
|
ageText += Game1.content.LoadString("Strings\\UI:AnimalQuery_AgeBaby");
|
||||||
|
@ -58,26 +53,10 @@ namespace stardew_access.Patches
|
||||||
parent = Game1.content.LoadString("Strings\\UI:AnimalQuery_Parent", ___parentName);
|
parent = Game1.content.LoadString("Strings\\UI:AnimalQuery_Parent", ___parentName);
|
||||||
}
|
}
|
||||||
|
|
||||||
// The loveLevel varies between 0 and 1
|
|
||||||
// 1 indicates 5 hearts and similarily 0 indicates 0 hearts
|
|
||||||
// the below code multiplies the loveLevel by 10 and
|
|
||||||
// the numeric value of the resultent is divided by 2 to give the number of full hearts and
|
|
||||||
// if its decimal value is above 0.5, then that indicates half a heart
|
|
||||||
double heartCount = Math.Floor(loveLevel * 10);
|
|
||||||
double remainder = (loveLevel * 10) % 1;
|
|
||||||
heartCount /= 2;
|
|
||||||
if (remainder >= 0.5)
|
|
||||||
{
|
|
||||||
heartCount += 0.5;
|
|
||||||
}
|
|
||||||
|
|
||||||
MainClass.DebugLog($"Lovelevel: {loveLevel}");
|
|
||||||
string heart = MainClass.Translate("patch.animal_query_menu.heart", new { count = heartCount });
|
|
||||||
|
|
||||||
isNarratingAnimalInfo = true;
|
isNarratingAnimalInfo = true;
|
||||||
Task.Delay(200).ContinueWith(_ => { isNarratingAnimalInfo = false; }); // Adds delay
|
Task.Delay(200).ContinueWith(_ => { isNarratingAnimalInfo = false; }); // Adds delay
|
||||||
|
|
||||||
MainClass.ScreenReader.Say($"Name: {name} Type: {type} \n\t {ageText} {parent} \n\t {heart}", true);
|
MainClass.ScreenReader.Say($"Name: {name} Type: {type} \n\t Age: {ageText} {parent}", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void narrateHoveredButton(AnimalQueryMenu __instance, FarmAnimal ___animal, bool ___confirmingSell, int x, int y)
|
private static void narrateHoveredButton(AnimalQueryMenu __instance, FarmAnimal ___animal, bool ___confirmingSell, int x, int y)
|
||||||
|
|
|
@ -24,7 +24,7 @@ namespace stardew_access.Patches
|
||||||
|
|
||||||
if (___onFarm && ___namingAnimal)
|
if (___onFarm && ___namingAnimal)
|
||||||
{
|
{
|
||||||
narrateNamingMenu(__instance, ___textBox, x, y);
|
narrateNamingMenu(__instance, x, y);
|
||||||
}
|
}
|
||||||
else if (___onFarm && !___namingAnimal)
|
else if (___onFarm && !___namingAnimal)
|
||||||
{
|
{
|
||||||
|
@ -42,7 +42,7 @@ namespace stardew_access.Patches
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void narrateNamingMenu(PurchaseAnimalsMenu __instance, TextBox ___textBox, int x, int y)
|
private static void narrateNamingMenu(PurchaseAnimalsMenu __instance, int x, int y)
|
||||||
{
|
{
|
||||||
string toSpeak = "";
|
string toSpeak = "";
|
||||||
if (__instance.okButton != null && __instance.okButton.containsPoint(x, y))
|
if (__instance.okButton != null && __instance.okButton.containsPoint(x, y))
|
||||||
|
@ -60,9 +60,9 @@ namespace stardew_access.Patches
|
||||||
else if (__instance.textBoxCC != null && __instance.textBoxCC.containsPoint(x, y))
|
else if (__instance.textBoxCC != null && __instance.textBoxCC.containsPoint(x, y))
|
||||||
{
|
{
|
||||||
toSpeak = "Name Text Box";
|
toSpeak = "Name Text Box";
|
||||||
string? name = ___textBox.Text;
|
// string? value = ___textBox.Text;
|
||||||
if (name != null)
|
// if (value != "" && value != null && value != "null")
|
||||||
toSpeak = $"{toSpeak}, Value: {name}";
|
// toSpeak = $"{toSpeak}, Value: {value}";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (purchaseAnimalMenuQuery == toSpeak) return;
|
if (purchaseAnimalMenuQuery == toSpeak) return;
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -12,7 +12,5 @@
|
||||||
"manuallytriggered.healthnstamina.percent":"Gesundheit ist {{health}} % und Ausdauer ist {{stamina}} %",
|
"manuallytriggered.healthnstamina.percent":"Gesundheit ist {{health}} % und Ausdauer ist {{stamina}} %",
|
||||||
"manuallytriggered.healthnstamina.normal":"Gesundheit ist {{health}} und Ausdauer ist {{stamina}}",
|
"manuallytriggered.healthnstamina.normal":"Gesundheit ist {{health}} und Ausdauer ist {{stamina}}",
|
||||||
"readtile.sprinkler.pressurenozzle":"Druck-{{value}}",
|
"readtile.sprinkler.pressurenozzle":"Druck-{{value}}",
|
||||||
"readtile.sprinkler.enricher": "Bereichernd {{value}}",
|
"readtile.sprinkler.enricher":"Bereichernd {{value}}"
|
||||||
"patch.animal_query_menu.heart": "Anzahl der Herzen: {{count}}",
|
|
||||||
"patch.trash_bear.wanted_item": "{{trash_bear_name}} möchte {{item_name}} haben!"
|
|
||||||
}
|
}
|
|
@ -12,7 +12,5 @@
|
||||||
"manuallytriggered.healthnstamina.percent":"Health is {{health}} % and Stamina is {{stamina}} %",
|
"manuallytriggered.healthnstamina.percent":"Health is {{health}} % and Stamina is {{stamina}} %",
|
||||||
"manuallytriggered.healthnstamina.normal":"Health is {{health}} and Stamina is {{stamina}}",
|
"manuallytriggered.healthnstamina.normal":"Health is {{health}} and Stamina is {{stamina}}",
|
||||||
"readtile.sprinkler.pressurenozzle":"Pressurized {{value}}",
|
"readtile.sprinkler.pressurenozzle":"Pressurized {{value}}",
|
||||||
"readtile.sprinkler.enricher": "Enriching {{value}}",
|
"readtile.sprinkler.enricher":"Enriching {{value}}"
|
||||||
"patch.animal_query_menu.heart": "Heart Count: {{count}}",
|
|
||||||
"patch.trash_bear.wanted_item": "{{trash_bear_name}} wants {{item_name}}!"
|
|
||||||
}
|
}
|
|
@ -12,7 +12,5 @@
|
||||||
"manuallytriggered.healthnstamina.percent":"La salud es {{health}} % y la resistencia es {{stamina}} %",
|
"manuallytriggered.healthnstamina.percent":"La salud es {{health}} % y la resistencia es {{stamina}} %",
|
||||||
"manuallytriggered.healthnstamina.normal":"La salud es {{health}} y la resistencia es {{stamina}}",
|
"manuallytriggered.healthnstamina.normal":"La salud es {{health}} y la resistencia es {{stamina}}",
|
||||||
"readtile.sprinkler.pressurenozzle":"presurizada {{value}}",
|
"readtile.sprinkler.pressurenozzle":"presurizada {{value}}",
|
||||||
"readtile.sprinkler.enricher": "Enriquecedora {{value}}",
|
"readtile.sprinkler.enricher":"Enriquecedora {{value}}"
|
||||||
"patch.animal_query_menu.heart": "Conteo de corazones: {{count}}",
|
|
||||||
"patch.trash_bear.wanted_item": "¡{{trash_bear_name}} quiere {{item_name}}!"
|
|
||||||
}
|
}
|
|
@ -12,7 +12,5 @@
|
||||||
"manuallytriggered.healthnstamina.percent":"La santé est de {{health}} % et l'endurance est de {{stamina}} %",
|
"manuallytriggered.healthnstamina.percent":"La santé est de {{health}} % et l'endurance est de {{stamina}} %",
|
||||||
"manuallytriggered.healthnstamina.normal":"La santé est {{health}} et l'endurance est {{stamina}}",
|
"manuallytriggered.healthnstamina.normal":"La santé est {{health}} et l'endurance est {{stamina}}",
|
||||||
"readtile.sprinkler.pressurenozzle":"Sous pression {{value}}",
|
"readtile.sprinkler.pressurenozzle":"Sous pression {{value}}",
|
||||||
"readtile.sprinkler.enricher": "Enrichissant {{value}}",
|
"readtile.sprinkler.enricher":"Enrichissant {{value}}"
|
||||||
"patch.animal_query_menu.heart": "Nombre de cœurs : {{count}}",
|
|
||||||
"patch.trash_bear.wanted_item": "{{trash_bear_name}} veut {{item_name}} !"
|
|
||||||
}
|
}
|
|
@ -12,7 +12,5 @@
|
||||||
"manuallytriggered.healthnstamina.percent":"Az egészségi állapot {{health}} %, az állóképesség pedig {{stamina}} %",
|
"manuallytriggered.healthnstamina.percent":"Az egészségi állapot {{health}} %, az állóképesség pedig {{stamina}} %",
|
||||||
"manuallytriggered.healthnstamina.normal":"Az egészség {{health}}, az állóképesség pedig {{stamina}}",
|
"manuallytriggered.healthnstamina.normal":"Az egészség {{health}}, az állóképesség pedig {{stamina}}",
|
||||||
"readtile.sprinkler.pressurenozzle":"Nyomás alatt {{value}}",
|
"readtile.sprinkler.pressurenozzle":"Nyomás alatt {{value}}",
|
||||||
"readtile.sprinkler.enricher": "Gazdagítás {{value}}",
|
"readtile.sprinkler.enricher":"Gazdagítás {{value}}"
|
||||||
"patch.animal_query_menu.heart": "Szív szám: {{count}}",
|
|
||||||
"patch.trash_bear.wanted_item": "{{trash_bear_name}} szeretné {{item_name}}!"
|
|
||||||
}
|
}
|
|
@ -12,7 +12,5 @@
|
||||||
"manuallytriggered.healthnstamina.percent":"La salute è {{health}} % e la resistenza è {{stamina}} %",
|
"manuallytriggered.healthnstamina.percent":"La salute è {{health}} % e la resistenza è {{stamina}} %",
|
||||||
"manuallytriggered.healthnstamina.normal":"La salute è {{health}} e la resistenza è {{stamina}}",
|
"manuallytriggered.healthnstamina.normal":"La salute è {{health}} e la resistenza è {{stamina}}",
|
||||||
"readtile.sprinkler.pressurenozzle":"Pressurizzato {{value}}",
|
"readtile.sprinkler.pressurenozzle":"Pressurizzato {{value}}",
|
||||||
"readtile.sprinkler.enricher": "Arricchimento {{value}}",
|
"readtile.sprinkler.enricher":"Arricchimento {{value}}"
|
||||||
"patch.animal_query_menu.heart": "Conteggio cuori: {{count}}",
|
|
||||||
"patch.trash_bear.wanted_item": "{{trash_bear_name}} vuole {{item_name}}!"
|
|
||||||
}
|
}
|
|
@ -12,7 +12,5 @@
|
||||||
"manuallytriggered.healthnstamina.percent":"体力は {{health}} %、スタミナは {{stamina}} %",
|
"manuallytriggered.healthnstamina.percent":"体力は {{health}} %、スタミナは {{stamina}} %",
|
||||||
"manuallytriggered.healthnstamina.normal":"体力は{{health}}、スタミナは{{stamina}}です",
|
"manuallytriggered.healthnstamina.normal":"体力は{{health}}、スタミナは{{stamina}}です",
|
||||||
"readtile.sprinkler.pressurenozzle":"加圧 {{value}}",
|
"readtile.sprinkler.pressurenozzle":"加圧 {{value}}",
|
||||||
"readtile.sprinkler.enricher": "豊かにする {{value}}",
|
"readtile.sprinkler.enricher":"豊かにする {{value}}"
|
||||||
"patch.animal_query_menu.heart": "ハート数:{{count}}",
|
|
||||||
"patch.trash_bear.wanted_item": "{{trash_bear_name}}は{{item_name}}が欲しい!"
|
|
||||||
}
|
}
|
|
@ -12,7 +12,5 @@
|
||||||
"manuallytriggered.healthnstamina.percent":"체력은 {{health}} %이고 체력은 {{stamina}} %입니다.",
|
"manuallytriggered.healthnstamina.percent":"체력은 {{health}} %이고 체력은 {{stamina}} %입니다.",
|
||||||
"manuallytriggered.healthnstamina.normal":"체력은 {{health}}이고 체력은 {{stamina}}입니다.",
|
"manuallytriggered.healthnstamina.normal":"체력은 {{health}}이고 체력은 {{stamina}}입니다.",
|
||||||
"readtile.sprinkler.pressurenozzle":"가압 {{value}}",
|
"readtile.sprinkler.pressurenozzle":"가압 {{value}}",
|
||||||
"readtile.sprinkler.enricher": "풍부하게 하기 {{value}}",
|
"readtile.sprinkler.enricher":"풍부하게 하기 {{value}}"
|
||||||
"patch.animal_query_menu.heart": "하트 개수: {{count}}",
|
|
||||||
"patch.trash_bear.wanted_item": "{{trash_bear_name}}가 {{item_name}}이(가) 필요합니다!"
|
|
||||||
}
|
}
|
|
@ -12,7 +12,5 @@
|
||||||
"manuallytriggered.healthnstamina.percent":"Saúde é {{health}} % e Stamina é {{stamina}} %",
|
"manuallytriggered.healthnstamina.percent":"Saúde é {{health}} % e Stamina é {{stamina}} %",
|
||||||
"manuallytriggered.healthnstamina.normal":"Saúde é {{health}} e Stamina é {{stamina}}",
|
"manuallytriggered.healthnstamina.normal":"Saúde é {{health}} e Stamina é {{stamina}}",
|
||||||
"readtile.sprinkler.pressurenozzle":"Pressurizada {{value}}",
|
"readtile.sprinkler.pressurenozzle":"Pressurizada {{value}}",
|
||||||
"readtile.sprinkler.enricher": "Enriquecimento {{value}}",
|
"readtile.sprinkler.enricher":"Enriquecimento {{value}}"
|
||||||
"patch.animal_query_menu.heart": "Contagem de corações: {{count}}",
|
|
||||||
"patch.trash_bear.wanted_item": "{{trash_bear_name}} quer {{item_name}}!"
|
|
||||||
}
|
}
|
|
@ -12,7 +12,5 @@
|
||||||
"manuallytriggered.healthnstamina.percent":"Здоровье составляет {{health}}%, а выносливость - {{stamina}}%",
|
"manuallytriggered.healthnstamina.percent":"Здоровье составляет {{health}}%, а выносливость - {{stamina}}%",
|
||||||
"manuallytriggered.healthnstamina.normal":"Здоровье – {{health}}, а выносливость – {{stamina}}.",
|
"manuallytriggered.healthnstamina.normal":"Здоровье – {{health}}, а выносливость – {{stamina}}.",
|
||||||
"readtile.sprinkler.pressurenozzle":"под давлением {{value}}",
|
"readtile.sprinkler.pressurenozzle":"под давлением {{value}}",
|
||||||
"readtile.sprinkler.enricher": "Обогащение {{value}}",
|
"readtile.sprinkler.enricher":"Обогащение {{value}}"
|
||||||
"patch.animal_query_menu.heart": "Количество сердец: {{count}}",
|
|
||||||
"patch.trash_bear.wanted_item": "{{trash_bear_name}} хочет {{item_name}}!"
|
|
||||||
}
|
}
|
|
@ -12,7 +12,5 @@
|
||||||
"manuallytriggered.healthnstamina.percent":"Sağlık %{{health}} ve Dayanıklılık %{{stamina}}",
|
"manuallytriggered.healthnstamina.percent":"Sağlık %{{health}} ve Dayanıklılık %{{stamina}}",
|
||||||
"manuallytriggered.healthnstamina.normal":"Sağlık {{health}} ve Dayanıklılık {{stamina}}",
|
"manuallytriggered.healthnstamina.normal":"Sağlık {{health}} ve Dayanıklılık {{stamina}}",
|
||||||
"readtile.sprinkler.pressurenozzle":"basınçlı {{value}}",
|
"readtile.sprinkler.pressurenozzle":"basınçlı {{value}}",
|
||||||
"readtile.sprinkler.enricher": "zenginleştirici {{value}}",
|
"readtile.sprinkler.enricher":"zenginleştirici {{value}}"
|
||||||
"patch.animal_query_menu.heart": "Kalp Sayısı: {{count}}",
|
|
||||||
"patch.trash_bear.wanted_item": "{{trash_bear_name}} {{item_name}} istiyor!"
|
|
||||||
}
|
}
|
|
@ -12,7 +12,5 @@
|
||||||
"manuallytriggered.healthnstamina.percent":"健康为 {{health}} %,耐力为 {{stamina}} %",
|
"manuallytriggered.healthnstamina.percent":"健康为 {{health}} %,耐力为 {{stamina}} %",
|
||||||
"manuallytriggered.healthnstamina.normal":"健康为 {{health}},耐力为 {{stamina}}",
|
"manuallytriggered.healthnstamina.normal":"健康为 {{health}},耐力为 {{stamina}}",
|
||||||
"readtile.sprinkler.pressurenozzle":"加压 {{value}}",
|
"readtile.sprinkler.pressurenozzle":"加压 {{value}}",
|
||||||
"readtile.sprinkler.enricher": "丰富 {{value}}",
|
"readtile.sprinkler.enricher":"丰富 {{value}}"
|
||||||
"patch.animal_query_menu.heart": "心数量:{{count}}",
|
|
||||||
"patch.trash_bear.wanted_item": "{{trash_bear_name}} 想要 {{item_name}}!"
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue