Added command to change Screen.Fade color

This commit is contained in:
Vitaly Mikhailov 2019-10-11 21:39:42 +03:00
parent f56696df23
commit 6e0b1d1550
No known key found for this signature in database
GPG Key ID: 46EFF05D37A3FA18
3 changed files with 25 additions and 4 deletions

View File

@ -9,7 +9,8 @@ Public Class OverworldScreen
#Region "Fields"
Private Shared _fadeValue As Integer = 0 'Fade progress value for the black screen fade.
Private Shared _fadeColor As Color = Color.Black 'Fade screen color.
Private Shared _fadeValue As Integer = 0 'Fade progress value for the screen fade.
Private Shared _drawRodID As Integer = -1 'The rod ID to display on the screen during the fishing animation.
Private _actionScript As ActionScript 'Private ActionScript instance.
@ -57,7 +58,19 @@ Public Class OverworldScreen
End Property
''' <summary>
''' Fade progress value for the black screen fade.
''' Fade color for the screen.
''' </summary>
Public Shared Property FadeColor() As Color
Get
Return _fadeColor
End Get
Set(value As Color)
_fadeColor = value
End Set
End Property
''' <summary>
''' Fade progress value for the screen fade.
''' </summary>
Public Shared Property FadeValue() As Integer
Get
@ -378,7 +391,7 @@ Public Class OverworldScreen
'If the black fade is visible, render it:
If FadeValue > 0 Then
Canvas.DrawRectangle(Core.windowSize, New Color(0, 0, 0, FadeValue))
Canvas.DrawRectangle(Core.windowSize, New Color(FadeColor.R, FadeColor.G, FadeColor.B, FadeValue))
End If
End Sub

View File

@ -106,7 +106,7 @@
End If
If FadeValue > 0 Then
Canvas.DrawRectangle(windowSize, New Color(0, 0, 0, FadeValue))
Canvas.DrawRectangle(windowSize, New Color(FadeColor.R, FadeColor.G, FadeColor.B, FadeValue))
End If
End Sub

View File

@ -91,6 +91,14 @@
Else
IsReady = True
End If
Case "fadeoutcolor"
If Not String.IsNullOrEmpty(argument) Then
Dim colorR As Integer = int(argument.GetSplit(0))
Dim colorG As Integer = int(argument.GetSplit(1))
Dim colorB As Integer = int(argument.GetSplit(2))
OverworldScreen.FadeColor = New Color(colorR, colorG, colorB)
End If
IsReady = True
Case "setfade"
OverworldScreen.FadeValue = int(argument).Clamp(0, 255)
IsReady = True