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("<rivalname>", Core.Player.RivalName)
result = result.Replace("<rival.name>", Core.Player.RivalName) result = result.Replace("<rival.name>", Core.Player.RivalName)
End If End If
If result.Contains("<name>") Then
result = result.Replace("<name>", "//POKEMONNAME//")
End If
If result.Contains("<") Then If result.Contains("<") Then
result = CStr(ScriptVersion2.ScriptComparer.EvaluateConstruct(result)) result = CStr(ScriptVersion2.ScriptComparer.EvaluateConstruct(result))
End If End If

View File

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