Fixed attack description outside box & sfx no stop

This commit is contained in:
JappaWakka 2022-09-20 14:33:09 +02:00
parent 8a61b2ba14
commit c695a8c57d
1 changed files with 3 additions and 22 deletions

View File

@ -120,26 +120,7 @@
End If
With Core.SpriteBatch
Dim fullText As String = A.Description
Dim t As String = ""
Dim i As Integer = 0
Dim n As String = ""
For i = 0 To fullText.Length - 1
Dim c As Char = CChar(fullText(i).ToString().Replace("", "'"))
If c = CChar(" ") Then
If FontManager.MainFont.MeasureString(n & c).X > 170 Then
t &= Environment.NewLine
n = ""
Else
t &= " "
n &= " "
End If
Else
t &= c
n &= c
End If
Next
Dim Description As String = A.Description.Replace("", "'").CropStringToWidth(FontManager.MainFont, 240)
Dim power As String = A.Power.ToString()
If power = "0" Then
@ -151,7 +132,7 @@
acc = "-"
End If
.DrawString(FontManager.MainFont, "Power: " & power & Environment.NewLine & "Accuracy: " & acc & Environment.NewLine & Environment.NewLine & t, New Vector2(CInt(p.X + 432 - 300 + AttackPos), p.Y + 40), Color.Black)
.DrawString(FontManager.MainFont, "Power: " & power & Environment.NewLine & "Accuracy: " & acc & Environment.NewLine & Environment.NewLine & Description, New Vector2(CInt(p.X + 432 - 300 + AttackPos), p.Y + 40), Color.Black)
.Draw(A.GetDamageCategoryImage(), New Rectangle(CInt(p.X + 432 - 144 + AttackPos + 24), CInt(p.Y + 40), 56, 28), Color.White)
End With
@ -304,7 +285,7 @@
Private Sub FollowUpText()
TextBox.Show("... " & Pokemon.GetDisplayName() & " learned~" & newAttack.Name & "!")
SoundManager.PlaySound("success_small", False)
SoundManager.PlaySound("success_small", True)
End Sub
End Class