Fix Item Finder and hidden item fading issues

This commit is contained in:
JappaWakka 2024-05-02 15:10:11 +02:00
parent 9873f15aa5
commit cab4e66cea
2 changed files with 11 additions and 5 deletions

View File

@ -14,6 +14,7 @@
Dim X, Y, width, height, rows, columns, animationSpeed, startRow, startColumn As Integer Dim X, Y, width, height, rows, columns, animationSpeed, startRow, startColumn As Integer
Dim CurrentRectangle As New Rectangle(0, 0, 0, 0) Dim CurrentRectangle As New Rectangle(0, 0, 0, 0)
Dim CanInteractWith As Boolean = True Dim CanInteractWith As Boolean = True
Public HiddenDelay As Date = Nothing
Public Overloads Sub Initialize(Optional ByVal AnimationData As List(Of List(Of Integer)) = Nothing) Public Overloads Sub Initialize(Optional ByVal AnimationData As List(Of List(Of Integer)) = Nothing)
MyBase.Initialize() MyBase.Initialize()
@ -101,11 +102,14 @@
End If End If
If Me.IsHiddenItem() = True Then If Me.IsHiddenItem() = True Then
If Me.Opacity > 0.0F Then If HiddenDelay <> Nothing AndAlso Date.Now >= HiddenDelay Then
Me.Opacity -= 0.01F If Me.Opacity > 0.0F Then
If Me.Opacity <= 0.0F Then Me.Opacity -= 0.01F
Me.Opacity = 1.0F If Me.Opacity <= 0.0F Then
Me.Visible = False Me.Opacity = 0.0F
Me.Visible = False
End If
Me.NormalOpacity = Me.Opacity
End If End If
End If End If
End If End If

View File

@ -20,7 +20,9 @@ Namespace Items.KeyItems
Dim i As ItemObject = CType(e, ItemObject) Dim i As ItemObject = CType(e, ItemObject)
If i.IsHiddenItem() = True Then If i.IsHiddenItem() = True Then
i.Opacity = 1.0F i.Opacity = 1.0F
i.NormalOpacity = 1.0F
i.Visible = True i.Visible = True
i.HiddenDelay = Date.Now + New TimeSpan(0, 0, 3)
found = True found = True
End If End If
End If End If