Fix tooltip object leak; lootvalue sorting table workaround; 1.6.7

This commit is contained in:
Tyfon
2024-06-11 16:25:10 -07:00
parent 7ba0a67929
commit 1163d08c30
8 changed files with 54 additions and 22 deletions

View File

@@ -28,10 +28,6 @@ namespace UIFixes
{
if (scrollRect != null)
{
Rect contentRect = scrollRect.content.rect;
Rect viewRect = scrollRect.RectTransform().rect;
float pageSize = viewRect.height / contentRect.height;
if (Settings.UseHomeEnd.Value)
{
if (Input.GetKeyDown(KeyCode.Home))
@@ -48,10 +44,23 @@ namespace UIFixes
{
if (Input.GetKeyDown(KeyCode.PageUp))
{
// Duplicate this code to avoid running it every frame
Rect contentRect = scrollRect.content.rect;
Rect viewRect = scrollRect.RectTransform().rect;
float pageSize = viewRect.height / contentRect.height;
scrollRect.verticalNormalizedPosition = Math.Min(1f, scrollRect.verticalNormalizedPosition + pageSize);
}
if (Input.GetKeyDown(KeyCode.PageDown))
{
// Duplicate this code to avoid running it every frame
Rect contentRect = scrollRect.content.rect;
Rect viewRect = scrollRect.RectTransform().rect;
float pageSize = viewRect.height / contentRect.height;
scrollRect.verticalNormalizedPosition = Math.Max(0f, scrollRect.verticalNormalizedPosition - pageSize);
}
}