From 514bc5ecf590b65cc04f9421467868df8998c1fd Mon Sep 17 00:00:00 2001 From: CaptainSegis Date: Fri, 20 Jan 2017 20:56:15 -0500 Subject: [PATCH] Changed hall of fame to keep first entry + last 20 entries. --- 2.5DHero/2.5DHero/Screens/PC/HallOfFameScreen.vb | 11 ++++++++--- .../ActionScript/V2/ScriptCommands/DoPokemon.vb | 16 ++++++++++------ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/2.5DHero/2.5DHero/Screens/PC/HallOfFameScreen.vb b/2.5DHero/2.5DHero/Screens/PC/HallOfFameScreen.vb index 8e315d7c6..a20120c38 100644 --- a/2.5DHero/2.5DHero/Screens/PC/HallOfFameScreen.vb +++ b/2.5DHero/2.5DHero/Screens/PC/HallOfFameScreen.vb @@ -11,6 +11,7 @@ Dim texture As Texture2D Dim Entries As New List(Of HallOfFameEntry) + Dim AmountOfEntries As Integer = 0 Dim Scroll As Integer = 0 Dim Cursor As Integer = 0 @@ -118,6 +119,7 @@ If IsNumeric(s) = True Then If IDs.Contains(CInt(s)) = False Then IDs.Add(CInt(s)) + AmountOfEntries = CInt(s) + 1 End If End If End If @@ -194,7 +196,7 @@ Next Core.SpriteBatch.DrawString(FontManager.MainFont, "Entries: ", New Vector2(90 + 64 * 11, 119), New Color(0, 0, 0, alpha)) - Core.SpriteBatch.DrawString(FontManager.MainFont, Me.Entries.Count.ToString(), New Vector2(190 + 64 * 11, 119), New Color(255, 255, 255, alpha)) + Core.SpriteBatch.DrawString(FontManager.MainFont, AmountOfEntries.ToString(), New Vector2(190 + 64 * 11, 119), New Color(255, 255, 255, alpha)) DrawCursor() End If @@ -467,8 +469,11 @@ End If Next End If - - Return (count + 1) + count += 1 + If count > 21 Then + count = 21 + End If + Return count End Function End Class \ No newline at end of file diff --git a/2.5DHero/2.5DHero/World/ActionScript/V2/ScriptCommands/DoPokemon.vb b/2.5DHero/2.5DHero/World/ActionScript/V2/ScriptCommands/DoPokemon.vb index ed91e50e0..eea484943 100644 --- a/2.5DHero/2.5DHero/World/ActionScript/V2/ScriptCommands/DoPokemon.vb +++ b/2.5DHero/2.5DHero/World/ActionScript/V2/ScriptCommands/DoPokemon.vb @@ -433,7 +433,7 @@ End If Case "registerhalloffame" Dim count As Integer = -1 - + Dim NewHallOfFameData As String = "" If Core.Player.HallOfFameData <> "" Then Dim data() As String = Core.Player.HallOfFameData.SplitAtNewline() @@ -443,6 +443,13 @@ count = id End If Next + + For Each l As String In data + Dim id As Integer = CInt(l.Remove(l.IndexOf(","))) + If id > (count - 19) OrElse id = 0 Then 'last 20 entries saved, plus the first entry + NewHallOfFameData &= l & vbNewLine + End If + Next End If count += 1 @@ -464,11 +471,8 @@ End If Next - If Core.Player.HallOfFameData <> "" Then - Core.Player.HallOfFameData &= vbNewLine - End If - - Core.Player.HallOfFameData &= newData + NewHallOfFameData &= newData + Core.Player.HallOfFameData = NewHallOfFameData Case "setot" Dim Index As Integer = int(argument.GetSplit(0, ",")) Dim OT As String = argument.GetSplit(1, ",")