Some bug fixes.
This commit is contained in:
parent
459fd8124f
commit
d31f1a0827
|
@ -34,6 +34,7 @@ namespace UIInfoSuite
|
|||
helper.Events.GameLoop.Saved += OnSaved;
|
||||
helper.Events.GameLoop.ReturnedToTitle += OnReturnedToTitle;
|
||||
helper.Events.Display.Rendering += IconHandler.Handler.Reset;
|
||||
helper.Events.GameLoop.GameLaunched += GameLoop_GameLaunched;
|
||||
|
||||
//Resources = new ResourceManager("UIInfoSuite.Resource.strings", Assembly.GetAssembly(typeof(ModEntry)));
|
||||
//try
|
||||
|
@ -47,6 +48,11 @@ namespace UIInfoSuite
|
|||
//}
|
||||
}
|
||||
|
||||
private void GameLoop_GameLaunched(object sender, GameLaunchedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>Raised after the game returns to the title screen.</summary>
|
||||
/// <param name="sender">The event sender.</param>
|
||||
private void OnReturnedToTitle(object sender, ReturnedToTitleEventArgs e)
|
||||
|
|
|
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
|||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.8.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.8.0.0")]
|
||||
[assembly: AssemblyVersion("1.8.3.0")]
|
||||
[assembly: AssemblyFileVersion("1.8.3.0")]
|
||||
|
|
|
@ -6,6 +6,7 @@ using StardewValley.Buildings;
|
|||
using StardewValley.Locations;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
|
||||
namespace UIInfoSuite.UIElements
|
||||
{
|
||||
|
@ -15,6 +16,8 @@ namespace UIInfoSuite.UIElements
|
|||
private readonly ModConfig _modConfig;
|
||||
private readonly IModEvents _events;
|
||||
|
||||
private readonly Mutex _mutex = new Mutex();
|
||||
|
||||
private static readonly int[][] _junimoHutArray = new int[17][]
|
||||
{
|
||||
new int[17] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
|
||||
|
@ -67,8 +70,19 @@ namespace UIInfoSuite.UIElements
|
|||
if (!e.IsMultipleOf(4))
|
||||
return;
|
||||
|
||||
if (_mutex.WaitOne())
|
||||
{
|
||||
try
|
||||
{
|
||||
// check draw tile outlines
|
||||
_effectiveArea.Clear();
|
||||
}
|
||||
finally
|
||||
{
|
||||
_mutex.ReleaseMutex();
|
||||
}
|
||||
|
||||
}
|
||||
if (Game1.activeClickableMenu == null &&
|
||||
!Game1.eventUp)
|
||||
{
|
||||
|
@ -174,12 +188,17 @@ namespace UIInfoSuite.UIElements
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>Raised after the game draws to the sprite patch in a draw tick, just before the final sprite batch is rendered to the screen.</summary>
|
||||
/// <param name="sender">The event sender.</param>
|
||||
/// <param name="e">The event arguments.</param>
|
||||
private void OnRendered(object sender, RenderedEventArgs e)
|
||||
{
|
||||
if (_mutex.WaitOne(0))
|
||||
{
|
||||
try
|
||||
{
|
||||
// draw tile outlines
|
||||
foreach (Point point in _effectiveArea)
|
||||
|
@ -194,10 +213,21 @@ namespace UIInfoSuite.UIElements
|
|||
SpriteEffects.None,
|
||||
0.01f);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_mutex.ReleaseMutex();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ParseConfigToHighlightedArea(int[][] highlightedLocation, int xPos, int yPos)
|
||||
{
|
||||
int xOffset = highlightedLocation.Length / 2;
|
||||
|
||||
if (_mutex.WaitOne())
|
||||
{
|
||||
try
|
||||
{
|
||||
for (int i = 0; i < highlightedLocation.Length; ++i)
|
||||
{
|
||||
int yOffset = highlightedLocation[i].Length / 2;
|
||||
|
@ -208,6 +238,12 @@ namespace UIInfoSuite.UIElements
|
|||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
_mutex.ReleaseMutex();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int TileUnderMouseX
|
||||
{
|
||||
|
|
|
@ -139,7 +139,8 @@ namespace UIInfoSuite.UIElements
|
|||
private void OnRenderedHud(object sender, RenderedHudEventArgs e)
|
||||
{
|
||||
// draw hover text
|
||||
if (_toolBeingUpgraded != null && _toolUpgradeIcon.containsPoint(Game1.getMouseX(), Game1.getMouseY()))
|
||||
if (_toolBeingUpgraded != null &&
|
||||
(_toolUpgradeIcon?.containsPoint(Game1.getMouseX(), Game1.getMouseY()) ?? false))
|
||||
{
|
||||
IClickableMenu.drawHoverText(
|
||||
Game1.spriteBatch,
|
||||
|
|
|
@ -79,7 +79,7 @@ namespace UIInfoSuite.UIElements
|
|||
private void OnRenderedHud(object sender, RenderedHudEventArgs e)
|
||||
{
|
||||
// draw hover text
|
||||
if (_travelingMerchantIsHere && _travelingMerchantIcon.containsPoint(Game1.getMouseX(), Game1.getMouseY()))
|
||||
if (_travelingMerchantIsHere && (_travelingMerchantIcon?.containsPoint(Game1.getMouseX(), Game1.getMouseY()) ?? false))
|
||||
{
|
||||
string hoverText = _helper.SafeGetString(
|
||||
LanguageKeys.TravelingMerchantIsInTown);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"Name": "UI Info Suite",
|
||||
"Author": "Cdaragorn",
|
||||
"Version": "1.8.0",
|
||||
"Version": "1.8.3",
|
||||
"Description": "Adds a lot of useful information to the user interface. This is based on Demiacle's excellent UIModSuite.",
|
||||
"UniqueID": "Cdaragorn.UiInfoSuite",
|
||||
"EntryDll": "UIInfoSuite.dll",
|
||||
|
|
Loading…
Reference in New Issue