Fixed accurate hearts and npc location checkboxes.

This commit is contained in:
cdaragorn 2018-05-06 14:41:04 -06:00
parent 628fa38555
commit 32bd9c1157
2 changed files with 9 additions and 9 deletions

View File

@ -133,11 +133,9 @@ namespace UIInfoSuite.UIElements
if (menu is SocialPage) if (menu is SocialPage)
{ {
_socialPage = menu as SocialPage; _socialPage = menu as SocialPage;
var npcNames = typeof(SocialPage).GetField("npcNames", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(menu) as Dictionary<String, String>; _friendNames = (typeof(SocialPage).GetField("names", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(menu) as List<object>)
_friendNames = npcNames.Keys.ToArray(); .Select(name => name.ToString())
//_friendNames = typeof(SocialPage) .ToArray();
// .GetField("npcNames", BindingFlags.Instance | BindingFlags.NonPublic)
// .GetValue(menu) as List<ClickableTextureComponent>;
break; break;
} }
} }

View File

@ -62,7 +62,8 @@ namespace UIInfoSuite.UIElements
int yPosition = Game1.activeClickableMenu.yPositionOnScreen + 130 + yOffset; int yPosition = Game1.activeClickableMenu.yPositionOnScreen + 130 + yOffset;
yOffset += 112; yOffset += 112;
Friendship friendshipValues; Friendship friendshipValues;
if (Game1.player.friendshipData.TryGetValue(_friendNames[i], out friendshipValues)) String nextName = _friendNames[i];
if (Game1.player.friendshipData.TryGetValue(nextName, out friendshipValues))
{ {
int friendshipRawValue = friendshipValues.Points; int friendshipRawValue = friendshipValues.Points;
@ -115,8 +116,9 @@ namespace UIInfoSuite.UIElements
if (menu is SocialPage) if (menu is SocialPage)
{ {
_socialPage = menu as SocialPage; _socialPage = menu as SocialPage;
var npcNames = typeof(SocialPage).GetField("npcNames", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(_socialPage) as Dictionary<String, String>; _friendNames = (typeof(SocialPage).GetField("names", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(_socialPage) as List<object>)
_friendNames = npcNames.Keys.ToArray(); .Select(name => name.ToString())
.ToArray();
break; break;
} }
} }
@ -125,7 +127,7 @@ namespace UIInfoSuite.UIElements
private void DrawEachIndividualSquare(int friendshipLevel, int friendshipPoints, int yPosition) private void DrawEachIndividualSquare(int friendshipLevel, int friendshipPoints, int yPosition)
{ {
int numberOfPointsToDraw = friendshipPoints / 20; int numberOfPointsToDraw = (int)(((double)friendshipPoints) / 12.5);
int num2; int num2;
if (friendshipLevel > 10) if (friendshipLevel > 10)