Fix PokeInteract Parsing Crash

This commit is contained in:
JappaWakka 2024-09-14 14:35:53 +02:00
parent 11f8f9cc5c
commit 9739e6eecd
2 changed files with 13 additions and 8 deletions

View File

@ -114,6 +114,9 @@
result = result.Replace("<rivalname>", Core.Player.RivalName)
result = result.Replace("<rival.name>", Core.Player.RivalName)
End If
If result.Contains("<name>") Then
result = result.Replace("<name>", "//POKEMONNAME//")
End If
If result.Contains("<") Then
result = CStr(ScriptVersion2.ScriptComparer.EvaluateConstruct(result))
End If

View File

@ -766,7 +766,9 @@
Me.HasNotification = False
Else
Me.HasNotification = True
Me.Notification = Me.ConvertEmoji(dataParts(7))
Dim EmojiText As String = dataParts(7).Replace(">:(", "shouting").Replace("<3", "heart").Replace(":(", "unhappy").Replace(":)", "friendly").Replace(";)", "wink").Replace("/:(", "angry")
EmojiText = ScriptVersion2.ScriptCommander.Parse(EmojiText).ToString()
Me.Notification = Me.ConvertEmoji(EmojiText)
End If
Me.Message = dataParts(8)
@ -783,29 +785,29 @@
Return MessageBulb.NotificationTypes.Waiting
Case "!"
Return MessageBulb.NotificationTypes.Exclamation
Case ">:("
Case ">:(", "shouting"
Return MessageBulb.NotificationTypes.Shouting
Case "?"
Return MessageBulb.NotificationTypes.Question
Case "note"
Return MessageBulb.NotificationTypes.Note
Case "<3"
Case "<3", "heart"
Return MessageBulb.NotificationTypes.Heart
Case ":("
Case ":(", "unhappy"
Return MessageBulb.NotificationTypes.Unhappy
Case "ball"
Return MessageBulb.NotificationTypes.Battle
Case ":D"
Return MessageBulb.NotificationTypes.Happy
Case ":)"
Case ":)", "friendly"
Return MessageBulb.NotificationTypes.Friendly
Case "bad"
Return MessageBulb.NotificationTypes.Poisoned
Case ";)"
Case ";)", "wink"
Return MessageBulb.NotificationTypes.Wink
Case "afk"
Return MessageBulb.NotificationTypes.AFK
Case "/:("
Case "/:(", "angry"
Return MessageBulb.NotificationTypes.Angry
Case ":3"
Return MessageBulb.NotificationTypes.CatFace
@ -873,7 +875,7 @@
End Function
Public Function GetMessage(ByVal p As Pokemon) As String
Return ScriptVersion2.ScriptCommander.Parse(Me.Message.Replace("<name>", p.GetDisplayName())).ToString
Return ScriptVersion2.ScriptCommander.Parse(Me.Message.Replace("<name>", p.GetDisplayName())).ToString.Replace("//POKEMONNAME//", p.GetDisplayName())
End Function
End Class