Merge pull request #65 from Dreuu/master

Merging Branch from Dreuu.
This commit is contained in:
Gamer2020 2023-09-13 13:27:23 -04:00 committed by GitHub
commit 7d1a46484d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
62 changed files with 4544 additions and 1674 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -32,7 +32,7 @@ Public Class BattleFrontierEditor
Else
MsgBox("This ROM is not supported!!!")
End
Me.Close()
End If
End Sub

View File

@ -10,8 +10,8 @@ Module ChangeImageFunctions
Dim ImgBytes As Byte()
Dim PalBytes As Byte()
Dim ImgNewOffset As String
Dim PalNewOffset As String
Dim ImgNewOffset As String = ""
Dim PalNewOffset As String = ""
ImgBytes = ConvertStringToByteArray(CompressLz77String(ConvertByteArrayToString(Sprite)))
PalBytes = ConvertStringToByteArray(CompressLz77String(ConvertPaletteToString(pallete)))
@ -19,16 +19,51 @@ Module ChangeImageFunctions
ImgString = ByteArrayToHexString(ImgBytes)
PalString = ByteArrayToHexString(PalBytes)
ImgNewOffset = SearchFreeSpaceFourAligned(LoadedROM, &HFF, ((Len(ImgString) / 2)), "&H" & GetString(GetINIFileLocation(), header, "StartSearchingForSpaceOffset", "800000"))
Dim alreadyInsertedPic As Boolean = False
Dim alreadyInsertedPal As Boolean = False
If Pokemonedit.CheckBox1.Checked Then
If Pokemonedit.PicStrings.Count > 0 Then
Dim countNum As Integer = 0
For Each oldPic As String In Pokemonedit.PicStrings
If String.Compare(ImgString, oldPic) = 0 Then
alreadyInsertedPic = True
ImgNewOffset = Pokemonedit.PicOffsets(countNum)
Exit For
End If
WriteHEX(LoadedROM, ImgNewOffset, ImgString)
countNum += 1
Next
End If
If Pokemonedit.PicStrings.Count > 0 Then
Dim countNum As Integer = 0
For Each oldPal As String In Pokemonedit.PalStrings
If String.Compare(PalString, oldPal) = 0 Then
alreadyInsertedPal = True
PalNewOffset = Pokemonedit.PalOffsets(countNum)
Exit For
End If
countNum += 1
Next
End If
End If
If Not alreadyInsertedPic Then
ImgNewOffset = SearchFreeSpaceFourAligned(LoadedROM, &HFF, ((Len(ImgString) / 2)), "&H" & GetString(GetINIFileLocation(), header, "StartSearchingForSpaceOffset", "800000"))
Pokemonedit.PicStrings.Add(ImgString)
Pokemonedit.PicOffsets.Add(ImgNewOffset)
WriteHEX(LoadedROM, ImgNewOffset, ImgString)
End If
If Not alreadyInsertedPal Then
PalNewOffset = SearchFreeSpaceFourAligned(LoadedROM, &HFF, ((Len(PalString) / 2)), "&H" & GetString(GetINIFileLocation(), header, "StartSearchingForSpaceOffset", "800000"))
Pokemonedit.PalStrings.Add(PalString)
Pokemonedit.PalOffsets.Add(PalNewOffset)
WriteHEX(LoadedROM, PalNewOffset, PalString)
End If
WriteHEX(LoadedROM, sOffset, ReverseHEX(Hex((ImgNewOffset) + &H8000000)))
PalNewOffset = SearchFreeSpaceFourAligned(LoadedROM, &HFF, ((Len(PalString) / 2)), "&H" & GetString(GetINIFileLocation(), header, "StartSearchingForSpaceOffset", "800000"))
WriteHEX(LoadedROM, PalNewOffset, PalString)
WriteHEX(LoadedROM, pOffset, ReverseHEX(Hex((PalNewOffset) + &H8000000)))
End Sub
@ -43,8 +78,8 @@ Module ChangeImageFunctions
Dim ImgBytes As Byte()
Dim PalBytes As Byte()
Dim ImgNewOffset As String
Dim PalNewOffset As String
Dim ImgNewOffset As String = ""
Dim PalNewOffset As String = ""
ImgBytes = ConvertStringToByteArray(CompressLz77String(ConvertByteArrayToString(Sprite)))
PalBytes = ConvertStringToByteArray(CompressLz77String(ConvertPaletteToString(pallete)))
@ -52,16 +87,51 @@ Module ChangeImageFunctions
ImgString = ByteArrayToHexString(ImgBytes)
PalString = ByteArrayToHexString(PalBytes)
ImgNewOffset = SearchFreeSpaceFourAligned(LoadedROM, &HFF, ((Len(ImgString) / 2)), "&H" & GetString(GetINIFileLocation(), header, "StartSearchingForSpaceOffset", "800000"))
Dim alreadyInsertedPic As Boolean = False
Dim alreadyInsertedPal As Boolean = False
If Pokemonedit.CheckBox1.Checked Then
If Pokemonedit.PicStrings.Count > 0 Then
Dim countNum As Integer = 0
For Each oldPic As String In Pokemonedit.PicStrings
If String.Compare(ImgString, oldPic) = 0 Then
alreadyInsertedPic = True
ImgNewOffset = Pokemonedit.PicOffsets(countNum)
Exit For
End If
WriteHEX(LoadedROM, ImgNewOffset, ImgString)
countNum += 1
Next
End If
If Pokemonedit.PicStrings.Count > 0 Then
Dim countNum As Integer = 0
For Each oldPal As String In Pokemonedit.PalStrings
If String.Compare(PalString, oldPal) = 0 Then
alreadyInsertedPal = True
PalNewOffset = Pokemonedit.PalOffsets(countNum)
Exit For
End If
countNum += 1
Next
End If
End If
If Not alreadyInsertedPic Then
ImgNewOffset = SearchFreeSpaceFourAligned(LoadedROM, &HFF, ((Len(ImgString) / 2)), "&H" & GetString(GetINIFileLocation(), header, "StartSearchingForSpaceOffset", "800000"))
Pokemonedit.PicStrings.Add(ImgString)
Pokemonedit.PicOffsets.Add(ImgNewOffset)
WriteHEX(LoadedROM, ImgNewOffset, ImgString)
End If
If Not alreadyInsertedPal Then
PalNewOffset = SearchFreeSpaceFourAligned(LoadedROM, &HFF, ((Len(PalString) / 2)), "&H" & GetString(GetINIFileLocation(), header, "StartSearchingForSpaceOffset", "800000"))
Pokemonedit.PalStrings.Add(PalString)
Pokemonedit.PalOffsets.Add(PalNewOffset)
WriteHEX(LoadedROM, PalNewOffset, PalString)
End If
WriteHEX(LoadedROM, sOffset, ReverseHEX(Hex((ImgNewOffset) + &H8000000)))
PalNewOffset = SearchFreeSpaceFourAligned(LoadedROM, &HFF, ((Len(PalString) / 2)), "&H" & GetString(GetINIFileLocation(), header, "StartSearchingForSpaceOffset", "800000"))
WriteHEX(LoadedROM, PalNewOffset, PalString)
WriteHEX(LoadedROM, pOffset, ReverseHEX(Hex((PalNewOffset) + &H8000000)))
End Sub

View File

@ -24,18 +24,24 @@ Module CryFunctions
Public Function LoadCry(index As Integer, cryTable As Integer) As Cry
Dim CryToLoad As New Cry
'If ledrom Is Nothing Then
' Return False
'End If
' load cry table entry
'ledrom.Seek(cryTable + index * 12)
'Dim someValue = ledrom.ReadInt32()
'Dim cryOffset = ledrom.ReadPointer()
'Dim cryShape = ledrom.ReadInt32()
Dim CryToLoad As New Cry With {
.Index = index
}
Dim convIndex As Integer = -1
If index > 276 Then
Dim offset As Integer = Int32.Parse((GetString(GetINIFileLocation(), header, "CryConversionTable", "")), System.Globalization.NumberStyles.HexNumber)
convIndex = Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, ((offset)) + ((index - 276) * 2), 2))), System.Globalization.NumberStyles.HexNumber)
End If
Dim someValue = Int32.Parse(ReverseHEX((ReadHEX(LoadedROM, (cryTable) + (index * 12), 4))), System.Globalization.NumberStyles.HexNumber)
Dim cryOffset = (Int32.Parse(ReverseHEX((ReadHEX(LoadedROM, (cryTable) + (index * 12) + 4, 4))), System.Globalization.NumberStyles.HexNumber) - &H8000000)
@ -50,7 +56,14 @@ Module CryFunctions
'ledrom.Seek(cryOffset)
CryToLoad.Offset = cryOffset
CryToLoad.Index = index
If convIndex <> -1 Then
someValue = Int32.Parse(ReverseHEX((ReadHEX(LoadedROM, (cryTable) + (convIndex * 12), 4))), System.Globalization.NumberStyles.HexNumber)
cryOffset = (Int32.Parse(ReverseHEX((ReadHEX(LoadedROM, (cryTable) + (convIndex * 12) + 4, 4))), System.Globalization.NumberStyles.HexNumber) - &H8000000)
cryShape = Int32.Parse(ReverseHEX((ReadHEX(LoadedROM, (cryTable) + (convIndex * 12) + 8, 4))), System.Globalization.NumberStyles.HexNumber)
CryToLoad.Offset = cryOffset
End If
'CryToLoad.Compressed = ledrom.ReadUInt16() = &H1
@ -68,14 +81,22 @@ Module CryFunctions
If Not CryToLoad.Compressed Then
' uncompressed, 1 sample per 1 byte of size
CryToLoad.Data = New SByte(CryToLoad.Size - 1) {}
For g As Integer = 0 To CryToLoad.Size - 1
CryToLoad.Data(g) = ByteToSignedInt("&H" & (ReadHEX(LoadedROM, (cryOffset) + 16 + g, 1)))
Dim cryToLoadTemp As String = ReadHEX(LoadedROM, (cryOffset) + 16, CryToLoad.Size - 1)
For g As Integer = 0 To CryToLoad.Size - 2
CryToLoad.Data(g) = ByteToSignedInt("&H" & cryToLoadTemp.Substring(g * 2, 2))
Next
'For g As Integer = 0 To CryToLoad.Size - 1
' CryToLoad.Data(g) = ByteToSignedInt("&H" & (ReadHEX(LoadedROM, (cryOffset) + 16 + g, 1)))
'Next
Else
' compressed, a bit of a hassle
Dim lookup = New SByte() {0, 1, 4, 9, 16, 25, _
36, 49, -64, -49, -36, -25, _
Dim lookup = New SByte() {0, 1, 4, 9, 16, 25,
36, 49, -64, -49, -36, -25,
-16, -9, -4, -1}
Dim start = (cryOffset) + 16
@ -83,31 +104,48 @@ Module CryFunctions
Dim alignment As Integer = 0, size As Integer = 0
Dim pcmLevel As SByte = 0
Dim pcmTemp As Int16 = 0
Dim data = New List(Of SByte)()
Dim cryData As String = (ReadHEX(LoadedROM, offtrack, CryToLoad.Size))
offtrack = 0
While True
If alignment = 0 Then
pcmLevel = ByteToSignedInt("&H" & (ReadHEX(LoadedROM, offtrack, 1)))
offtrack = offtrack + 1
pcmLevel = ByteToSignedInt("&H" & cryData.Substring(offtrack, 2)) '(ReadHEX(LoadedROM, offtrack, 1)))
pcmTemp = pcmLevel
offtrack = offtrack + 2 '1
data.Add(pcmLevel)
alignment = &H20
End If
Dim input As Byte = ("&H" & (ReadHEX(LoadedROM, offtrack, 1)))
offtrack = offtrack + 1
Dim input As Byte = ("&H" & cryData.Substring(offtrack, 2)) '(ReadHEX(LoadedROM, offtrack, 1)))
offtrack = offtrack + 2 '1
If alignment < &H20 Then
' first nybble
pcmLevel += lookup(input >> 4)
If Int16.Parse(pcmLevel) + lookup(input >> 4) < -128 Then
pcmLevel = 128 + lookup(input >> 4)
ElseIf Int16.Parse(pcmLevel) + lookup(input >> 4) > 127 Then
pcmLevel = -129 + lookup(input >> 4)
Else
pcmLevel += lookup(input >> 4)
End If
data.Add(pcmLevel)
End If
' second nybble
pcmLevel += lookup(input And &HF)
If Int16.Parse(pcmLevel) + lookup(input And &HF) < -128 Then
pcmLevel = 128 + lookup(input And &HF)
ElseIf Int16.Parse(pcmLevel) + lookup(input And &HF) > 127 Then
pcmLevel = -129 + lookup(input And &HF)
Else
pcmLevel += lookup(input And &HF)
End If
data.Add(pcmLevel)
' exit when currentSize >= cry.Size
@ -121,7 +159,7 @@ Module CryFunctions
CryToLoad.Data = data.ToArray()
' bytes needed to recompress
CryToLoad.Size = offtrack - start
CryToLoad.Size = offtrack / 2 'offtrack - start
End If
Return CryToLoad
@ -199,7 +237,7 @@ Module CryFunctions
Public Sub ExportCry(filename As String, cry As Cry)
If Cry.Offset = 0 Then
If cry.Offset = 0 Then
Return
End If
@ -222,10 +260,10 @@ Module CryFunctions
' format: 1 = wave_format_pcm
writer.Write(CUShort(1))
' channel count
writer.Write(Cry.SampleRate)
writer.Write(cry.SampleRate)
' sample rate
' * 1 * 8 / 8
writer.Write(Cry.SampleRate)
writer.Write(cry.SampleRate)
' SampleRate * NumChannels * BitsPerSample/8
' * 8 / 8
writer.Write(CUShort(1))
@ -235,7 +273,7 @@ Module CryFunctions
' data chunk
writer.Write(Encoding.ASCII.GetBytes("data"))
' chunk ID
writer.Write(Cry.Data.Length)
writer.Write(cry.Data.Length)
' chunk size
For Each sample As SByte In cry.Data
writer.Write(CByte(sample + &H80))
@ -249,7 +287,7 @@ Module CryFunctions
Public Function ImportCry(filename As String, CryToLoad As Cry) As Cry
'If Cry.Offset = 0 Then
'If Cry.Offset = 0 Then
' Return
'End If
@ -314,125 +352,339 @@ Module CryFunctions
End Function
Public Function SaveCry(crytosave As Cry, cryTable As Integer) As Boolean
'Public Function SaveCry(crytosave As Cry, cryTable As Integer) As Boolean
If crytosave.Offset = 0 Then
Return False
End If
' If crytosave.Offset = 0 Then
' Return False
' End If
' 'var lookup = new byte[] { 0x0, 0x1, 0x4, 0x9, 0x10, 0x19, 0x24, 0x31, 0xC0, 0xCF, 0xDC, 0xE7, 0xF0, 0xF7, 0xFC, 0xFF };
' Dim lookup = New SByte() {0, 1, 4, 9, 16, 25,
' 36, 49, -64, -49, -36, -25,
' -16, -9, -4, -1}
' crytosave.Compressed = Pokemonedit.chkCompressed1.Checked
' ' copy cry data to be written
' Dim data = New List(Of Byte)()
' If crytosave.Compressed Then
' 'MsgBox("This should not be enabled!")
' 'End
' ' data is compressed in blocks of 1 + 0x20 bytes at a time
' ' first byte is normal signed PCM data
' ' following 0x20 bytes are compressed based on previous value
' ' (for a value not in lookup table, closest value will be chosen instead)
' 'Console.WriteLine("compressed");
' ' each block has 0x40 samples
' Dim blockCount = crytosave.Data.Length / &H40
' If crytosave.Data.Length Mod &H40 > 0 Then
' blockCount += 1
' End If
' ' truncates the length of the last block
' ' so we don't waste space
' Dim lastBlockSize = crytosave.Data.Length - crytosave.Data.Length / &H40 * &H40
' If lastBlockSize = 0 Then
' lastBlockSize = &H21
' Else
' lastBlockSize = 1 + (lastBlockSize / 2) + (If(lastBlockSize Mod 2 = 0, 0, 1))
' End If
' Dim blocks = New Byte(blockCount - 1)() {}
' For n As Integer = 0 To blockCount - 1
' ' create new block
' If n < blockCount - 1 Then
' blocks(n) = New Byte(32) {}
' Else
' blocks(n) = New Byte(lastBlockSize - 1) {}
' End If
' Dim i As Integer = n * &H40
' Dim k As Integer = 0
' If i < crytosave.Data.Length Then
' ' set first value
' blocks(n)(k) = BitConverter.GetBytes(crytosave.Data(i))(0)
' End If
' k = k + 1
' Dim pcm As SByte
' If i < crytosave.Data.Length Then
' pcm = crytosave.Data(i)
' End If
' i = i + 1
' Dim j As Integer = 1
' While j < &H40 And i < crytosave.Data.Length
' ' get current sample
' Dim sample As SByte = crytosave.Data(i)
' i = i + 1
' ' difference between previous sample and this
' Dim diff As Integer = sample - pcm
' ' check for a perfect match in lookup table
' Dim lookupI = -1
' For x As Integer = 0 To 15
' If lookup(x) = diff And (pcm + diff <= 127) And (pcm + diff >= -128) Then
' lookupI = x
' Exit For
' End If
' Next
' ' search for the closest match in the table
' If lookupI = -1 Then
' Dim bestDiff As Integer = 255
' For x As Integer = 0 To 15
' If Math.Abs(CInt(lookup(x)) - diff) < bestDiff And (pcm + lookup(x) <= 127) And (pcm + lookup(x) >= -128) Then
' lookupI = x
' bestDiff = Math.Abs(lookup(x) - diff)
' End If
' Next
' End If
' ' set value in block
' ' on an odd value, increase position in block
' If j Mod 2 = 0 Then
' blocks(n)(k) = blocks(n)(k) Or CByte(lookupI << 4)
' Else
' blocks(n)(k) = blocks(n)(k) Or CByte(lookupI)
' k = k + 1
' End If
' ' set previous
' pcm = sample
' j += 1
' End While
' Next
' For n As Integer = 0 To blockCount - 1
' data.AddRange(blocks(n))
' Next
' Else
' ' uncompressed, copy directly to data
' 'Console.WriteLine("uncompressed");
' For Each s As SByte In crytosave.Data
' data.Add(CByte(s And &HFF))
' Next
' End If
' ' determine if cry requires repointing
' If crytosave.Size < data.Count Then
' Dim result As DialogResult = MessageBox.Show("The Cry will be written to free space and the pointer will be repointed. Would you like to do that?",
' "Repoint?",
' MessageBoxButtons.YesNo)
' If (result = DialogResult.Yes) Then
' Dim result2 As DialogResult = MessageBox.Show("Fill the old cry with free space?",
' "Delete old cry?",
' MessageBoxButtons.YesNo)
' If (result2 = DialogResult.Yes) Then
' WriteHEX(LoadedROM, crytosave.Offset, MakeFreeSpaceString(crytosave.Size + 16))
' End If
' ' set new cry offset
' crytosave.Offset = SearchFreeSpaceFourAligned(LoadedROM, &HFF, data.Count, "&H" & GetString(GetINIFileLocation(), header, "StartSearchingForSpaceOffset", "800000"))
' Else
' Return False
' End If
' End If
' ' write cry
' WriteHEX(LoadedROM, crytosave.Offset, ReverseHEX(VB.Right("0000" & CUShort(If(crytosave.Compressed, 1, 0)), 4)))
' WriteHEX(LoadedROM, crytosave.Offset + 2, ReverseHEX(VB.Right("0000" & CUShort(If(crytosave.Looped, &H4000, 0)), 4)))
' WriteHEX(LoadedROM, crytosave.Offset + 4, ReverseHEX(VB.Right("00000000" & (crytosave.SampleRate << 10), 8)))
' WriteHEX(LoadedROM, crytosave.Offset + 8, ReverseHEX(VB.Right("00000000" & (crytosave.LoopStart), 8)))
' WriteHEX(LoadedROM, crytosave.Offset + 12, ReverseHEX(VB.Right("00000000" & (crytosave.Data.Length - 1), 8)))
' 'WriteHEX(LoadedROM, crytosave.Offset, ReverseHEX(VB.Right("0000" & CUShort(If(crytosave.Compressed, 1, 0)), 4)))
' 'WriteHEX(LoadedROM, crytosave.Offset + 2, ReverseHEX(VB.Right("0000" & CUShort(If(crytosave.Looped, &H4000, 0)), 4)))
' 'WriteHEX(LoadedROM, crytosave.Offset + 4, ReverseHEX(VB.Right("00000000" & (crytosave.SampleRate << 10), 8)))
' 'WriteHEX(LoadedROM, crytosave.Offset + 8, ReverseHEX(VB.Right("00000000" & (crytosave.LoopStart), 8)))
' 'WriteHEX(LoadedROM, crytosave.Offset + 12, ReverseHEX(VB.Right("00000000" & (crytosave.Data.Length - 1), 8)))
' Dim tempbuff As String = ByteArrayToHexString(data.ToArray)
' WriteHEX(LoadedROM, crytosave.Offset + 16, tempbuff)
' ' write cry table entry
' 'WriteHEX(LoadedROM, cryTable + (crytosave.Index * 12), ReverseHEX(If(crytosave.Compressed, "00003C20", "00003C00")))
' 'WriteHEX(LoadedROM, cryTable + (crytosave.Index * 12) + 4, ReverseHEX(VB.Right("00000000" & Hex(crytosave.Offset), 8)))
' 'WriteHEX(LoadedROM, cryTable + (crytosave.Index * 12) + 8, "FF00FF")
' 'rom.WriteUInt16(CUShort(If(Cry.Compressed, 1, 0)))
' 'rom.WriteUInt16(CUShort(If(Cry.Looped, &H4000, 0)))
' 'rom.WriteInt32(Cry.SampleRate << 10)
' 'rom.WriteInt32(Cry.LoopStart)
' 'rom.WriteInt32(Cry.Data.Length - 1)
' 'rom.WriteBytes(data.ToArray())
' '' write cry table entry
' 'rom.Seek(cryTable + Cry.Index * 12)
' 'rom.WriteUInt32(If(Cry.Compressed, &H3C20UI, &H3C00UI))
' 'rom.WritePointer(Cry.Offset)
' 'rom.WriteUInt32(&HFF00FFUI)
' '' write growl table entry
' 'rom.Seek(growlTable + Cry.Index * 12)
' 'rom.WriteUInt32(If(Cry.Compressed, &H3C30UI, &H3C00UI))
' '' !!! not sure if 00 should be used for uncompressed
' 'rom.WritePointer(Cry.Offset)
' 'rom.WriteUInt32(&HFF00FFUI)
' Return True
'End Function
Public Function SaveCryNoPrompt(crytosave As Cry, cryTable As Integer, growlTable As Integer) As Boolean
'If crytosave.Offset = 0 Then
'Return False
'End If
'var lookup = new byte[] { 0x0, 0x1, 0x4, 0x9, 0x10, 0x19, 0x24, 0x31, 0xC0, 0xCF, 0xDC, 0xE7, 0xF0, 0xF7, 0xFC, 0xFF };
Dim lookup = New SByte() {0, 1, 4, 9, 16, 25, _
36, 49, -64, -49, -36, -25, _
Dim lookup = New SByte() {0, 1, 4, 9, 16, 25,
36, 49, -64, -49, -36, -25,
-16, -9, -4, -1}
crytosave.Compressed = False
crytosave.Compressed = Pokemonedit.imptCompChk.Checked
' copy cry data to be written
Dim data = New List(Of Byte)()
If crytosave.Compressed Then
MsgBox("This should not be enabled!")
End
'' data is compressed in blocks of 1 + 0x20 bytes at a time
'' first byte is normal signed PCM data
'' following 0x20 bytes are compressed based on previous value
'' (for a value not in lookup table, closest value will be chosen instead)
''Console.WriteLine("compressed");
'MsgBox("This should not be enabled!")
'End
'' each block has 0x40 samples
'Dim blockCount = crytosave.Data.Length / &H40
'If crytosave.Data.Length Mod &H40 > 0 Then
' blockCount += 1
'End If
' data is compressed in blocks of 1 + 0x20 bytes at a time
' first byte is normal signed PCM data
' following 0x20 bytes are compressed based on previous value
' (for a value not in lookup table, closest value will be chosen instead)
'Console.WriteLine("compressed");
'' truncates the length of the last block
'' so we don't waste space
'Dim lastBlockSize = crytosave.Data.Length - crytosave.Data.Length / &H40 * &H40
'If lastBlockSize = 0 Then
' lastBlockSize = &H21
'Else
' lastBlockSize = 1 + (lastBlockSize / 2) + (If(lastBlockSize Mod 2 = 0, 0, 1))
'End If
' each block has 0x40 samples
Dim blockCount = crytosave.Data.Length / &H40
If crytosave.Data.Length Mod &H40 > 0 Then
blockCount += 1
End If
'Dim blocks = New Byte(blockCount - 1)() {}
'For n As Integer = 0 To blockCount - 1
' ' create new block
' If n < blockCount - 1 Then
' blocks(n) = New Byte(32) {}
' Else
' blocks(n) = New Byte(lastBlockSize - 1) {}
' End If
' truncates the length of the last block
' so we don't waste space
Dim lastBlockSize = crytosave.Data.Length - crytosave.Data.Length / &H40 * &H40
If lastBlockSize = 0 Then
lastBlockSize = &H21
Else
lastBlockSize = 1 + (lastBlockSize / 2) + (If(lastBlockSize Mod 2 = 0, 0, 1))
End If
' Dim i As Integer = n * &H40
' Dim k As Integer = 0
Dim blocks = New Byte(blockCount - 1)() {}
For n As Integer = 0 To blockCount - 1
' create new block
If n < blockCount - 1 Then
blocks(n) = New Byte(32) {}
Else
blocks(n) = New Byte(lastBlockSize - 1) {} ' - Not "- 1"
End If
' If i < crytosave.Data.Length Then
' ' set first value
' blocks(n)(k) = BitConverter.GetBytes(crytosave.Data(i))(0)
' End If
Dim i As Integer = n * &H40
Dim k As Integer = 0
' k = k + 1
If i < crytosave.Data.Length Then
' set first value
blocks(n)(k) = BitConverter.GetBytes(crytosave.Data(i))(0)
End If
' Dim pcm As SByte
k = k + 1
' If i < crytosave.Data.Length Then
Dim pcm As SByte
' pcm = crytosave.Data(i)
If i < crytosave.Data.Length Then
' End If
pcm = crytosave.Data(i)
' i = i + 1
End If
' Dim j As Integer = 1
' While j < &H40 And i < crytosave.Data.Length
' ' get current sample
' Dim sample As SByte = crytosave.Data(i)
i = i + 1
' i = i + 1
Dim j As Integer = 1
While j < &H40 And i < crytosave.Data.Length
' get current sample
Dim sample As SByte = crytosave.Data(i)
' ' difference between previous sample and this
' Dim diff As Integer = sample - pcm
i = i + 1
' ' check for a perfect match in lookup table
' Dim lookupI = -1
' For x As Integer = 0 To 15
' If lookup(x) = diff Then
' lookupI = x
' Exit For
' End If
' Next
' difference between previous sample and this
Dim diff As Integer = Int16.Parse(sample) - Int16.Parse(pcm)
' ' search for the closest match in the table
' If lookupI = -1 Then
' Dim bestDiff As Integer = 255
' For x As Integer = 0 To 15
' If Math.Abs(CInt(lookup(x)) - diff) < bestDiff Then
' lookupI = x
' bestDiff = Math.Abs(lookup(x) - diff)
' End If
' Next
' End If
Dim lookupI = -1
' search for the closest match in the table
Dim bestDiff As Integer = 255
For x As Integer = 0 To 15
'If ((Math.Abs(CInt(lookup(x)) - diff) < bestDiff) Or (lookup(x) = diff)) And Not ((lookup(x) < 0 And diff > 0) Or (lookup(x) > 0 And diff < 0)) Then ' Good or Perfect Difference
If ((Math.Abs(CInt(lookup(x)) - diff) < bestDiff) Or (lookup(x) = diff)) Then ' Good or Perfect Difference
' ' set value in block
' ' on an odd value, increase position in block
' If j Mod 2 = 0 Then
' blocks(n)(k) = blocks(n)(k) Or CByte(lookupI << 4)
' Else
' blocks(n)(k) = blocks(n)(k) Or CByte(lookupI)
'Check for Overflow/Underflow to prevent crackling
If (Int16.Parse(pcm) + lookup(x) < 127) Then
' k = k + 1
If (Int16.Parse(pcm) + lookup(x) > -128) Then
' End If
lookupI = x
bestDiff = Math.Abs(lookup(x) - diff)
' ' set previous
' pcm = sample
' j += 1
' End While
'Next
Else
End If
Else
End If
End If
Next
' set value in block
' on an odd value, increase position in block
If j Mod 2 = 0 Then
blocks(n)(k) = blocks(n)(k) Or CByte(lookupI << 4)
Else
blocks(n)(k) = blocks(n)(k) Or CByte(lookupI)
k = k + 1
End If
' set previous
pcm = pcm + lookup(lookupI)
j += 1
End While
Next
For n As Integer = 0 To blockCount - 1
data.AddRange(blocks(n))
Next
'For n As Integer = 0 To blockCount - 1
' data.AddRange(blocks(n))
'Next
Else
' uncompressed, copy directly to data
'Console.WriteLine("uncompressed");
@ -441,50 +693,17 @@ Module CryFunctions
Next
End If
' determine if cry requires repointing
If crytosave.Size < data.Count Then
' set new cry offset
crytosave.Offset = SearchFreeSpaceFourAligned(LoadedROM, &HFF, data.Count + 16, "&H" & GetString(GetINIFileLocation(), header, "StartSearchingForSpaceOffset", "800000"))
Dim result As DialogResult = MessageBox.Show("The Cry will be written to free space and the pointer will be repointed. Would you like to do that?",
"Repoint?",
MessageBoxButtons.YesNo)
If (result = DialogResult.Yes) Then
Dim result2 As DialogResult = MessageBox.Show("Fill the old cry with free space?",
"Delete old cry?",
MessageBoxButtons.YesNo)
If (result2 = DialogResult.Yes) Then
WriteHEX(LoadedROM, crytosave.Offset, MakeFreeSpaceString(crytosave.Size + 16))
End If
' set new cry offset
crytosave.Offset = SearchFreeSpaceFourAligned(LoadedROM, &HFF, data.Count, "&H" & GetString(GetINIFileLocation(), header, "StartSearchingForSpaceOffset", "800000"))
Else
Return False
End If
End If
' write cry
WriteHEX(LoadedROM, crytosave.Offset, ReverseHEX(VB.Right("0000" & CUShort(If(crytosave.Compressed, 1, 0)), 4)))
WriteHEX(LoadedROM, crytosave.Offset + 2, ReverseHEX(VB.Right("0000" & CUShort(If(crytosave.Looped, &H4000, 0)), 4)))
WriteHEX(LoadedROM, crytosave.Offset + 4, ReverseHEX(VB.Right("00000000" & (crytosave.SampleRate << 10), 8)))
WriteHEX(LoadedROM, crytosave.Offset + 8, ReverseHEX(VB.Right("00000000" & (crytosave.LoopStart), 8)))
WriteHEX(LoadedROM, crytosave.Offset + 12, ReverseHEX(VB.Right("00000000" & (crytosave.Data.Length - 1), 8)))
WriteHEX(LoadedROM, crytosave.Offset + 4, ReverseHEX(VB.Right("00000000" & Hex(crytosave.SampleRate << 10), 8)))
WriteHEX(LoadedROM, crytosave.Offset + 8, ReverseHEX(VB.Right("00000000" & Hex(crytosave.LoopStart), 8)))
WriteHEX(LoadedROM, crytosave.Offset + 12, ReverseHEX(VB.Right("00000000" & Hex(crytosave.Data.Length - 1), 8)))
'WriteHEX(LoadedROM, crytosave.Offset, ReverseHEX(VB.Right("0000" & CUShort(If(crytosave.Compressed, 1, 0)), 4)))
'WriteHEX(LoadedROM, crytosave.Offset + 2, ReverseHEX(VB.Right("0000" & CUShort(If(crytosave.Looped, &H4000, 0)), 4)))
'WriteHEX(LoadedROM, crytosave.Offset + 4, ReverseHEX(VB.Right("00000000" & (crytosave.SampleRate << 10), 8)))
'WriteHEX(LoadedROM, crytosave.Offset + 8, ReverseHEX(VB.Right("00000000" & (crytosave.LoopStart), 8)))
'WriteHEX(LoadedROM, crytosave.Offset + 12, ReverseHEX(VB.Right("00000000" & (crytosave.Data.Length - 1), 8)))
Dim tempbuff As String = ByteArrayToHexString(data.ToArray)
@ -492,31 +711,24 @@ Module CryFunctions
' write cry table entry
'WriteHEX(LoadedROM, cryTable + (crytosave.Index * 12), ReverseHEX(If(crytosave.Compressed, "00003C20", "00003C00")))
'WriteHEX(LoadedROM, cryTable + (crytosave.Index * 12) + 4, ReverseHEX(VB.Right("00000000" & Hex(crytosave.Offset), 8)))
'WriteHEX(LoadedROM, cryTable + (crytosave.Index * 12) + 8, "FF00FF")
WriteHEX(LoadedROM, cryTable + ((crytosave.Index - 1) * 12), ReverseHEX(If(crytosave.Compressed, "00003C20", "00003C00")))
WriteHEX(LoadedROM, cryTable + ((crytosave.Index - 1) * 12) + 4, ReverseHEX(VB.Right("00000000" & Hex(crytosave.Offset + &H8000000), 8)))
WriteHEX(LoadedROM, cryTable + ((crytosave.Index - 1) * 12) + 8, "FF00FF")
WriteHEX(LoadedROM, growlTable + ((crytosave.Index - 1) * 12), ReverseHEX(If(crytosave.Compressed, "00003C30", "00003C00")))
WriteHEX(LoadedROM, growlTable + ((crytosave.Index - 1) * 12) + 4, ReverseHEX(VB.Right("00000000" & Hex(crytosave.Offset + &H8000000), 8)))
WriteHEX(LoadedROM, growlTable + ((crytosave.Index - 1) * 12) + 8, "FF00FF")
'rom.WriteUInt16(CUShort(If(Cry.Compressed, 1, 0)))
'rom.WriteUInt16(CUShort(If(Cry.Looped, &H4000, 0)))
'rom.WriteInt32(Cry.SampleRate << 10)
'rom.WriteInt32(Cry.LoopStart)
'rom.WriteInt32(Cry.Data.Length - 1)
'rom.WriteBytes(data.ToArray())
If crytosave.Index > 276 Then
'' write cry table entry
'rom.Seek(cryTable + Cry.Index * 12)
'rom.WriteUInt32(If(Cry.Compressed, &H3C20UI, &H3C00UI))
'rom.WritePointer(Cry.Offset)
'rom.WriteUInt32(&HFF00FFUI)
Dim offset As Integer = Int32.Parse((GetString(GetINIFileLocation(), header, "CryConversionTable", "")), System.Globalization.NumberStyles.HexNumber)
WriteHEX(LoadedROM, ((offset)) + ((crytosave.Index - 277) * 2), ReverseHEX(VB.Right("0000" & Hex(crytosave.Index - 1), 4)))
End If
'' write growl table entry
'rom.Seek(growlTable + Cry.Index * 12)
'rom.WriteUInt32(If(Cry.Compressed, &H3C30UI, &H3C00UI))
'' !!! not sure if 00 should be used for uncompressed
'rom.WritePointer(Cry.Offset)
'rom.WriteUInt32(&HFF00FFUI)
Return True
End Function
End Module

View File

@ -1,9 +1,9 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
Partial Class EggMoveEditor
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
<System.Diagnostics.DebuggerNonUserCode()>
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
@ -20,7 +20,7 @@ Partial Class EggMoveEditor
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
<System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(EggMoveEditor))
Me.ListBox1 = New System.Windows.Forms.ListBox()
@ -29,31 +29,41 @@ Partial Class EggMoveEditor
Me.ComboBox1 = New System.Windows.Forms.ComboBox()
Me.ComboBox2 = New System.Windows.Forms.ComboBox()
Me.FrntPic = New System.Windows.Forms.PictureBox()
Me.Button3 = New System.Windows.Forms.Button()
Me.Button4 = New System.Windows.Forms.Button()
Me.Button5 = New System.Windows.Forms.Button()
Me.Button6 = New System.Windows.Forms.Button()
Me.Label1 = New System.Windows.Forms.Label()
CType(Me.FrntPic, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'ListBox1
'
Me.ListBox1.FormattingEnabled = True
Me.ListBox1.Location = New System.Drawing.Point(12, 12)
Me.ListBox1.ItemHeight = 20
Me.ListBox1.Location = New System.Drawing.Point(18, 18)
Me.ListBox1.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.ListBox1.Name = "ListBox1"
Me.ListBox1.Size = New System.Drawing.Size(154, 238)
Me.ListBox1.Size = New System.Drawing.Size(229, 364)
Me.ListBox1.TabIndex = 0
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(182, 12)
Me.Button1.FlatStyle = System.Windows.Forms.FlatStyle.System
Me.Button1.Location = New System.Drawing.Point(273, 18)
Me.Button1.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(75, 23)
Me.Button1.Size = New System.Drawing.Size(112, 35)
Me.Button1.TabIndex = 1
Me.Button1.Text = "Insert"
Me.Button1.UseVisualStyleBackColor = True
'
'Button2
'
Me.Button2.Location = New System.Drawing.Point(182, 126)
Me.Button2.Location = New System.Drawing.Point(273, 194)
Me.Button2.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(75, 23)
Me.Button2.Size = New System.Drawing.Size(112, 35)
Me.Button2.TabIndex = 2
Me.Button2.Text = "Insert"
Me.Button2.UseVisualStyleBackColor = True
@ -62,33 +72,90 @@ Partial Class EggMoveEditor
'
Me.ComboBox1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems
Me.ComboBox1.FormattingEnabled = True
Me.ComboBox1.Location = New System.Drawing.Point(272, 14)
Me.ComboBox1.Location = New System.Drawing.Point(408, 22)
Me.ComboBox1.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.ComboBox1.Name = "ComboBox1"
Me.ComboBox1.Size = New System.Drawing.Size(121, 21)
Me.ComboBox1.Size = New System.Drawing.Size(180, 28)
Me.ComboBox1.TabIndex = 3
'
'ComboBox2
'
Me.ComboBox2.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems
Me.ComboBox2.FormattingEnabled = True
Me.ComboBox2.Location = New System.Drawing.Point(272, 128)
Me.ComboBox2.Location = New System.Drawing.Point(408, 197)
Me.ComboBox2.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.ComboBox2.Name = "ComboBox2"
Me.ComboBox2.Size = New System.Drawing.Size(121, 21)
Me.ComboBox2.Size = New System.Drawing.Size(180, 28)
Me.ComboBox2.TabIndex = 4
'
'FrntPic
'
Me.FrntPic.Location = New System.Drawing.Point(300, 41)
Me.FrntPic.Location = New System.Drawing.Point(450, 63)
Me.FrntPic.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.FrntPic.Name = "FrntPic"
Me.FrntPic.Size = New System.Drawing.Size(64, 64)
Me.FrntPic.Size = New System.Drawing.Size(96, 98)
Me.FrntPic.TabIndex = 10
Me.FrntPic.TabStop = False
'
'Button3
'
Me.Button3.Location = New System.Drawing.Point(273, 58)
Me.Button3.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.Button3.Name = "Button3"
Me.Button3.Size = New System.Drawing.Size(112, 35)
Me.Button3.TabIndex = 11
Me.Button3.Text = "Replace"
Me.Button3.UseVisualStyleBackColor = True
'
'Button4
'
Me.Button4.Location = New System.Drawing.Point(273, 126)
Me.Button4.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.Button4.Name = "Button4"
Me.Button4.Size = New System.Drawing.Size(112, 35)
Me.Button4.TabIndex = 12
Me.Button4.Text = "Delete"
Me.Button4.UseVisualStyleBackColor = True
'
'Button5
'
Me.Button5.Location = New System.Drawing.Point(273, 234)
Me.Button5.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.Button5.Name = "Button5"
Me.Button5.Size = New System.Drawing.Size(112, 35)
Me.Button5.TabIndex = 13
Me.Button5.Text = "Replace"
Me.Button5.UseVisualStyleBackColor = True
'
'Button6
'
Me.Button6.Location = New System.Drawing.Point(273, 347)
Me.Button6.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.Button6.Name = "Button6"
Me.Button6.Size = New System.Drawing.Size(112, 35)
Me.Button6.TabIndex = 14
Me.Button6.Text = "Save"
Me.Button6.UseVisualStyleBackColor = True
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(392, 241)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(226, 140)
Me.Label1.TabIndex = 15
Me.Label1.Text = resources.GetString("Label1.Text")
'
'EggMoveEditor
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleDimensions = New System.Drawing.SizeF(9.0!, 20.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(416, 262)
Me.ClientSize = New System.Drawing.Size(624, 403)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.Button6)
Me.Controls.Add(Me.Button5)
Me.Controls.Add(Me.Button4)
Me.Controls.Add(Me.Button3)
Me.Controls.Add(Me.FrntPic)
Me.Controls.Add(Me.ComboBox2)
Me.Controls.Add(Me.ComboBox1)
@ -97,12 +164,14 @@ Partial Class EggMoveEditor
Me.Controls.Add(Me.ListBox1)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.MaximizeBox = False
Me.Name = "EggMoveEditor"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "Egg Move Editor"
CType(Me.FrntPic, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
@ -112,4 +181,9 @@ Partial Class EggMoveEditor
Friend WithEvents ComboBox1 As ComboBox
Friend WithEvents ComboBox2 As ComboBox
Friend WithEvents FrntPic As PictureBox
Friend WithEvents Button3 As Button
Friend WithEvents Button4 As Button
Friend WithEvents Button5 As Button
Friend WithEvents Button6 As Button
Friend WithEvents Label1 As Label
End Class

View File

@ -117,6 +117,16 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Label1.Text" xml:space="preserve">
<value>WIP: Does not repoint data
even if it is longer than
the original table. Should
work fine for data as long
as, or shorter than
the original table.
BACK-UP BEFORE USE
</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>

View File

@ -1,6 +1,10 @@
Imports VB = Microsoft.VisualBasic
Imports System.IO
Imports VB = Microsoft.VisualBasic
Public Class EggMoveEditor
Dim EggMoveList As List(Of Integer)
Private Sub EggMoveEditor_Load(sender As Object, e As EventArgs) Handles MyBase.Load
@ -11,9 +15,26 @@ Public Class EggMoveEditor
Looper = 0
While ReadHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "EggMoveTable", "")), System.Globalization.NumberStyles.HexNumber) + (Looper * 2), 2) = "FFFF" = False
EggMoveList = New List(Of Integer)
CurEntry = Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, Int32.Parse(((GetString(GetINIFileLocation(), header, "EggMoveTable", ""))), System.Globalization.NumberStyles.HexNumber) + (Looper * 2), 2))), System.Globalization.NumberStyles.HexNumber)
Dim sOffset As Integer = Int32.Parse((GetString(GetINIFileLocation(), header, "EggMoveTable", "")), System.Globalization.NumberStyles.HexNumber)
Dim EggMoveString As String = ""
Using fs As New FileStream(LoadedROM, FileMode.Open, FileAccess.Read)
Using r As New BinaryReader(fs)
fs.Position = sOffset
Do
EggMoveString += VB.Right("0000" & Hex(Int32.Parse(r.ReadInt16)), 4)
Loop While EggMoveString.Substring(EggMoveString.Length - 4, 4).CompareTo("FFFF") <> 0
End Using
End Using
While EggMoveString.Substring(Looper * 4, 4) = "FFFF" = False
CurEntry = Int32.Parse(EggMoveString.Substring(Looper * 4, 4), System.Globalization.NumberStyles.HexNumber)
If CurEntry > 20000 Then
@ -24,6 +45,8 @@ Public Class EggMoveEditor
ListBox1.Items.Add(" " & GetAttackName(CurEntry))
End If
EggMoveList.Add(CurEntry)
Looper = Looper + 1
End While
@ -65,10 +88,10 @@ Public Class EggMoveEditor
GetAndDrawFrontPokemonPic(FrntPic, ComboBox1.SelectedIndex + 1)
End Sub
Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox1.SelectedIndexChanged
Private Sub ListBox1_SelectedIndexChanged() Handles ListBox1.SelectedIndexChanged
Dim CurEntry As Integer
CurEntry = Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, Int32.Parse(((GetString(GetINIFileLocation(), header, "EggMoveTable", ""))), System.Globalization.NumberStyles.HexNumber) + (ListBox1.SelectedIndex * 2), 2))), System.Globalization.NumberStyles.HexNumber)
CurEntry = EggMoveList(ListBox1.SelectedIndex)
If CurEntry > 20000 Then
@ -78,71 +101,131 @@ Public Class EggMoveEditor
ComboBox2.SelectedIndex = CurEntry
Dim tempLoop As Integer = ListBox1.SelectedIndex
Dim tempBuffer As Integer = CurEntry
While tempLoop >= 0 And tempBuffer < 20000
tempBuffer = EggMoveList(tempLoop)
tempLoop -= 1
End While
If tempBuffer > 20000 Then
ComboBox1.SelectedIndex = ((tempBuffer - 20000) - 1)
End If
End If
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim bufferCombo2 As Integer = ComboBox2.SelectedIndex
Dim IndexBuff As Integer = ListBox1.SelectedIndex
Dim Looper As Integer
Dim CurEntry As Integer
WriteHEX(LoadedROM, Int32.Parse(((GetString(GetINIFileLocation(), header, "EggMoveTable", ""))), System.Globalization.NumberStyles.HexNumber) + (ListBox1.SelectedIndex * 2), ReverseHEX(VB.Right("0000" & Hex(ComboBox1.SelectedIndex + 20001), 4)))
ListBox1.Items.Clear()
Looper = 0
While ReadHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "EggMoveTable", "")), System.Globalization.NumberStyles.HexNumber) + (Looper * 2), 2) = "FFFF" = False
CurEntry = Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, Int32.Parse(((GetString(GetINIFileLocation(), header, "EggMoveTable", ""))), System.Globalization.NumberStyles.HexNumber) + (Looper * 2), 2))), System.Globalization.NumberStyles.HexNumber)
If CurEntry > 20000 Then
ListBox1.Items.Add(GetPokemonName(CurEntry - 20000))
Else
ListBox1.Items.Add(" " & GetAttackName(CurEntry))
End If
Looper = Looper + 1
End While
ListBox1.SelectedIndex = IndexBuff
EggMoveList.Insert(ListBox1.SelectedIndex, ComboBox1.SelectedIndex + 20001)
ReloadEggMoves()
ComboBox2.SelectedIndex = bufferCombo2
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
EggMoveList.Insert(ListBox1.SelectedIndex, ComboBox2.SelectedIndex)
ReloadEggMoves()
End Sub
Private Sub ReloadEggMoves()
Dim bufferList As ListBox.ObjectCollection = New ListBox.ObjectCollection(New ListBox)
Dim Looper As Integer = 0
Dim AtBottom As Boolean = False
Dim IndexBuff As Integer = ListBox1.SelectedIndex
Dim Looper As Integer
Dim CurEntry As Integer
Dim NumberOfVisibleItems As Integer = Math.Ceiling(ListBox1.Height / ListBox1.ItemHeight)
Dim BottomIndex As Integer = 0 ' last visible index
If ListBox1.Items.Count - 1 > NumberOfVisibleItems Then
BottomIndex = ListBox1.TopIndex + NumberOfVisibleItems - 2
End If
WriteHEX(LoadedROM, Int32.Parse(((GetString(GetINIFileLocation(), header, "EggMoveTable", ""))), System.Globalization.NumberStyles.HexNumber) + (ListBox1.SelectedIndex * 2), ReverseHEX(VB.Right("0000" & Hex(ComboBox2.SelectedIndex), 4)))
If BottomIndex >= ListBox1.Items.Count() - 1 Then
AtBottom = True
End If
ListBox1.Items.Clear()
Looper = 0
While ReadHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "EggMoveTable", "")), System.Globalization.NumberStyles.HexNumber) + (Looper * 2), 2) = "FFFF" = False
CurEntry = Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, Int32.Parse(((GetString(GetINIFileLocation(), header, "EggMoveTable", ""))), System.Globalization.NumberStyles.HexNumber) + (Looper * 2), 2))), System.Globalization.NumberStyles.HexNumber)
For Each CurEntry In EggMoveList
If CurEntry > 20000 Then
ListBox1.Items.Add(GetPokemonName(CurEntry - 20000))
bufferList.Add(GetPokemonName(CurEntry - 20000))
Else
ListBox1.Items.Add(" " & GetAttackName(CurEntry))
bufferList.Add(" " & GetAttackName(CurEntry))
End If
Looper = Looper + 1
End While
ListBox1.SelectedIndex = IndexBuff
Looper = Looper + 1
Next
ListBox1.Items.Clear()
ListBox1.Items.AddRange(bufferList)
If AtBottom Then
ListBox1.SelectedIndex = ListBox1.Items.Count() - 1
End If
If ListBox1.Items.Count() - 1 >= BottomIndex Then
ListBox1.SelectedIndex = BottomIndex
Else
ListBox1.SelectedIndex = ListBox1.Items.Count() - 1
End If
If ListBox1.Items.Count() - 1 >= IndexBuff Then
ListBox1.SelectedIndex = IndexBuff
End If
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Dim bufferCombo2 As Integer = ComboBox2.SelectedIndex
EggMoveList(ListBox1.SelectedIndex) = ComboBox1.SelectedIndex + 20001
ReloadEggMoves()
ComboBox2.SelectedIndex = bufferCombo2
End Sub
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
EggMoveList(ListBox1.SelectedIndex) = ComboBox2.SelectedIndex
ReloadEggMoves()
End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
ListBox1_SelectedIndexChanged()
Dim bufferCombo1 As Integer = ComboBox1.SelectedIndex
Dim bufferCombo2 As Integer = ComboBox2.SelectedIndex
EggMoveList.RemoveAt(ListBox1.SelectedIndex)
ReloadEggMoves()
ComboBox1.SelectedIndex = bufferCombo1
ComboBox2.SelectedIndex = bufferCombo2
End Sub
Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
Dim bufferString As String = ""
Dim tempLoop As Integer = 0
For Each EggMove In EggMoveList
bufferString += ReverseHEX(VB.Right("0000" & Hex(EggMove), 4))
tempLoop += 1
Next
bufferString += "FFFF"
WriteHEX(LoadedROM, Int32.Parse(((GetString(GetINIFileLocation(), header, "EggMoveTable", ""))), System.Globalization.NumberStyles.HexNumber), bufferString)
End Sub
End Class

View File

@ -444,4 +444,116 @@ Module ExportDataFunctions
End Sub
Public Sub ExportTutorMoves(filename)
Dim moveTable As Integer = Int32.Parse((GetString(GetINIFileLocation(), header, "MoveTutorAttacks", "")), System.Globalization.NumberStyles.HexNumber)
Dim moveString As String = ""
Dim loopything As Integer = 0
While loopything < (Val(GetString(GetINIFileLocation(), header, "NumberOfMoveTutorAttacks", "")))
moveString = moveString & VB.Right("0000" & ReadHEX(LoadedROM, moveTable + (2 * loopything), 2), 4)
loopything = loopything + 1
End While
WriteString(filename, "TUTR", "TutorMoves", moveString)
End Sub
Public Sub ExportTMHMINI(INIFileName As String, ExportString As String)
WriteString(INIFileName, "TMHM", "TMHMData", ExportString)
End Sub
Public Sub ExportItemPicture(DataPath As String, ItemIndex As Integer, Optional Individual As Boolean = False)
Dim ItemPicDataOff As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "ItemIMGData", ""), System.Globalization.NumberStyles.HexNumber)
Dim ItemPalDataOff As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "ItemIMGData", ""), System.Globalization.NumberStyles.HexNumber)
Dim ItemPicDataOffSpecific As String = Hex(Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, ItemPicDataOff + (ItemIndex * 8), 4))), System.Globalization.NumberStyles.HexNumber) - &H8000000)
Dim ItemPalDataOffSpecific As String = Hex(Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, ItemPalDataOff + (ItemIndex * 8) + 4, 4))), System.Globalization.NumberStyles.HexNumber) - &H8000000)
Dim bitout As Bitmap = GetAndDrawItemIconToBitmap(ItemPicDataOffSpecific, ItemPalDataOffSpecific, True)
bitout.Save(DataPath)
End Sub
Public Sub ExportItemINI(DataPath As String, ItemIndex As Integer, Optional Individual As Boolean = False)
Dim DataFolder As String = DataPath
Dim ItemBaseOff As Integer = Int32.Parse((GetString(GetINIFileLocation(), header, "ItemData", "")), System.Globalization.NumberStyles.HexNumber)
Dim ItemPicDataOff As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "ItemIMGData", ""), System.Globalization.NumberStyles.HexNumber)
If Not Individual Then
DataPath = DataPath & "\Items\" & ItemIndex & ".ini"
End If
Dim ItemHex As String = ReadHEX(LoadedROM, ((ItemBaseOff) + 14) + (ItemIndex * 44), 30)
Dim ItemName As String = GetItemName(ItemIndex)
Dim ItemID As String = Int32.Parse((ReverseHEX(ItemHex.Substring(0, 4))), System.Globalization.NumberStyles.HexNumber)
Dim Price As String = Int32.Parse((ReverseHEX(ItemHex.Substring(4, 4))), System.Globalization.NumberStyles.HexNumber)
Dim HoldEffect As String = Int32.Parse((((ItemHex.Substring(8, 2)))), System.Globalization.NumberStyles.HexNumber)
Dim Value As String = Int32.Parse((((ItemHex.Substring(10, 2)))), System.Globalization.NumberStyles.HexNumber)
Dim DescriptionPointer As String = Hex(Int32.Parse((ReverseHEX(ItemHex.Substring(12, 8))), System.Globalization.NumberStyles.HexNumber) - &H8000000)
Dim Mystery1 As String = Int32.Parse((((ItemHex.Substring(20, 2)))), System.Globalization.NumberStyles.HexNumber)
Dim Mystery2 As String = Int32.Parse((((ItemHex.Substring(22, 2)))), System.Globalization.NumberStyles.HexNumber)
Dim Pocket As String = Int32.Parse((((ItemHex.Substring(24, 2)))), System.Globalization.NumberStyles.HexNumber)
Dim ItemType As String = Int32.Parse((((ItemHex.Substring(26, 2)))), System.Globalization.NumberStyles.HexNumber)
Dim FieldUsagePointer As String = Hex(Int32.Parse((ReverseHEX(ItemHex.Substring(28, 8))), System.Globalization.NumberStyles.HexNumber) - &H8000000)
Dim BattleUsagePointer As String = Hex(Int32.Parse((ReverseHEX(ItemHex.Substring(44, 8))), System.Globalization.NumberStyles.HexNumber) - &H8000000)
Dim BUText As String = Int32.Parse((((ItemHex.Substring(36, 2)))), System.Globalization.NumberStyles.HexNumber)
Dim ExtraParam As String = ReverseHEX(ItemHex.Substring(52, 8))
Dim ItemPicDataOffSpecific As String = Hex(Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, ItemPicDataOff + (ItemIndex * 8), 4))), System.Globalization.NumberStyles.HexNumber) - &H8000000)
Dim ItemPalDataOffSpecific As String = Hex(Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, ItemPicDataOff + (ItemIndex * 8) + 4, 4))), System.Globalization.NumberStyles.HexNumber) - &H8000000)
Dim CurrentItemDescripLength As Integer
FileNum = FreeFile()
FileOpen(FileNum, LoadedROM, OpenMode.Binary)
Dim ItemDescp As String = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
If ItemIndex = 377 Then
ItemDescp = ""
Else
FileGet(FileNum, ItemDescp, Int32.Parse(((DescriptionPointer)), System.Globalization.NumberStyles.HexNumber) + 1, True)
ItemDescp = Sapp2Asc(ItemDescp)
ItemDescp = Mid$(ItemDescp, 1, InStr(1, ItemDescp, "\x"))
'ItemDescp = Replace(ItemDescp, "\n", vbCrLf)
'ItemDescp = Replace(RTrim$(ItemDescp), "\", "")
ItemDescp = ItemDescp & "x"
End If
CurrentItemDescripLength = Len(ItemDescp)
FileClose(FileNum)
If Not Individual Then
ExportItemPicture(DataFolder & "\Items\ItemPics\" & ItemIndex & ".png", ItemIndex)
End If
If System.IO.File.Exists(DataPath) Then
System.IO.File.Delete(DataPath)
End If
WriteString(DataPath, "Item", "ItemName", ItemName)
WriteString(DataPath, "Item", "Price", Price)
WriteString(DataPath, "Item", "HoldEffect", HoldEffect)
WriteString(DataPath, "Item", "Value", Value)
WriteString(DataPath, "Item", "ItemDescp", ItemDescp)
WriteString(DataPath, "Item", "Mystery1", Mystery1)
WriteString(DataPath, "Item", "Mystery2", Mystery2)
WriteString(DataPath, "Item", "Pocket", Pocket)
WriteString(DataPath, "Item", "ItemType", ItemType)
WriteString(DataPath, "Item", "FieldUsagePointer", FieldUsagePointer)
WriteString(DataPath, "Item", "BattleUsagePointer", BattleUsagePointer)
WriteString(DataPath, "Item", "BUText", BUText)
WriteString(DataPath, "Item", "ExtraParam", ExtraParam)
WriteString(DataPath, "Item", "ItemName", ItemName)
End Sub
End Module

View File

@ -79,7 +79,7 @@
<ManifestKeyFile>GBAPokemonGameEditor_TemporaryKey.pfx</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<GenerateManifests>true</GenerateManifests>
<GenerateManifests>false</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<SignManifests>false</SignManifests>
@ -206,10 +206,10 @@
<Compile Include="mMain.vb" />
<Compile Include="modSearchFreeSpace.vb" />
<Compile Include="modTextSapp.vb" />
<Compile Include="movetutor2.Designer.vb">
<DependentUpon>movetutor2.vb</DependentUpon>
<Compile Include="MoveTutorEditor.Designer.vb">
<DependentUpon>MoveTutorEditor.vb</DependentUpon>
</Compile>
<Compile Include="movetutor2.vb">
<Compile Include="MoveTutorEditor.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="My Project\AssemblyInfo.vb" />
@ -335,8 +335,8 @@
<EmbeddedResource Include="MainFrm.resx">
<DependentUpon>MainFrm.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="movetutor2.resx">
<DependentUpon>movetutor2.vb</DependentUpon>
<EmbeddedResource Include="MoveTutorEditor.resx">
<DependentUpon>MoveTutorEditor.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="My Project\Resources.resx">
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>

View File

@ -1,16 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishUrlHistory>publish\|C:\Users\Gamer2020\Desktop\Test\|C:\Users\Gamer2020\Desktop\Pub\|http://gamer2020.0xrh.net/programs/GBAPokemonGameEditor/|C:\Users\Gamer2020\Desktop\</PublishUrlHistory>
<InstallUrlHistory />
<SupportUrlHistory />
<UpdateUrlHistory>http://gamer2020.0xrh.net/programs/GBAPokemonGameEditor/</UpdateUrlHistory>
<BootstrapperUrlHistory />
<ErrorReportUrlHistory />
<FallbackCulture>en-US</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
<ProjectView>ShowAllFiles</ProjectView>
</PropertyGroup>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<EnableSecurityDebugging>false</EnableSecurityDebugging>
</PropertyGroup>

View File

@ -854,6 +854,17 @@ ErrorHandle:
Dim Palette15(&HFFF) As Byte
Dim Palette32() As Color
Dim bSprite As Bitmap
Dim individualPalettes As Boolean = False
Dim pTableOffset As Integer = 0
Try
pTableOffset = Int32.Parse(GetString(GetINIFileLocation(), header, "IconPointerTable2", ""), System.Globalization.NumberStyles.HexNumber) + ((palindex * 8))
individualPalettes = True
Catch
End Try
Using fs As New FileStream(LoadedROM, FileMode.Open, FileAccess.Read)
Using r As New BinaryReader(fs)
fs.Position = sOffset
@ -866,7 +877,17 @@ ErrorHandle:
ReDim Temp(&HFFF)
'fs.Position = pOffset
'pOffset = r.ReadInt32 - &H8000000
fs.Position = pOffset
If Not individualPalettes Then
fs.Position = pOffset
Else
fs.Position = pTableOffset
pOffset = r.ReadInt32 - &H8000000
fs.Position = pOffset
End If
r.Read(Temp, 0, &HFFF)
'LZ77UnComp(Temp, Palette15)
@ -890,6 +911,17 @@ ErrorHandle:
Dim Palette15(&HFFF) As Byte
Dim Palette32() As Color
Dim bSprite As Bitmap
Dim individualPalettes As Boolean = False
Dim pTableOffset As Integer = 0
Try
pTableOffset = Int32.Parse(GetString(GetINIFileLocation(), header, "IconPointerTable2", ""), System.Globalization.NumberStyles.HexNumber) + ((palindex * 8))
individualPalettes = True
Catch
End Try
Using fs As New FileStream(LoadedROM, FileMode.Open, FileAccess.Read)
Using r As New BinaryReader(fs)
fs.Position = sOffset
@ -903,6 +935,15 @@ ErrorHandle:
'fs.Position = pOffset
'pOffset = r.ReadInt32 - &H8000000
fs.Position = pOffset
If Not individualPalettes Then
fs.Position = pOffset
Else
fs.Position = pTableOffset
pOffset = r.ReadInt32 - &H8000000
fs.Position = pOffset
End If
r.Read(Temp, 0, &HFFF)
'LZ77UnComp(Temp, Palette15)
@ -1194,4 +1235,33 @@ ErrorHandle:
End Function
Public Function GetAndDrawItemIconToBitmap(ByVal imgOffset As String, ByVal palOffset As String, Optional ShowBackColor As Boolean = False) As Bitmap
Dim Temp(&HFFF) As Byte
Dim Image(&HFFFF) As Byte
Dim Palette15(&HFFF) As Byte
Dim Palette32() As Color
Dim bSprite As Bitmap
Using fs As New FileStream(LoadedROM, FileMode.Open, FileAccess.Read)
Using r As New BinaryReader(fs)
fs.Position = Convert.ToInt32(imgOffset, 16)
r.Read(Temp, 0, &HFFF)
LZ77UnComp(Temp, Image)
ReDim Temp(&HFFF)
fs.Position = Convert.ToInt32(palOffset, 16)
r.Read(Temp, 0, &HFFF)
LZ77UnComp(Temp, Palette15)
Palette32 = LoadPalette(Palette15)
End Using
End Using
bSprite = LoadSprite(Image, Palette32, 24, 24, ShowBackColor)
GetAndDrawItemIconToBitmap = bSprite
End Function
End Module

View File

@ -4,14 +4,14 @@ Imports System.Net
Imports VB = Microsoft.VisualBasic
Module ImportDataFunctions
Private FrontPalette As Color() = New Color(&H10 - 1) {}
Private BackPalette As Color() = New Color(&H10 - 1) {}
Private FrontPalette As Color() = New Color(&H11 - 1) {}
Private BackPalette As Color() = New Color(&H11 - 1) {}
Private FrontSprite As Byte()
Private BackSprite As Byte()
Private AnimationNormalPalette As Color() = New Color(&H10 - 1) {}
Private AnimationShinyPalette As Color() = New Color(&H110 - 1) {}
Private AnimationNormalPalette As Color() = New Color(&H11 - 1) {}
Private AnimationShinyPalette As Color() = New Color(&H11 - 1) {}
Private AnimationNormalSprite As Byte()
Private AnimationShinySprite As Byte()
@ -54,7 +54,7 @@ Module ImportDataFunctions
Dim FrontAnimationTable As String = ""
Dim BackAnimTable As String = ""
Dim AnimDelayTable As String = ""
Dim EggMoveList As String = ""
'Load data
@ -113,7 +113,7 @@ Module ImportDataFunctions
NationalDexNumber = GetString(INIFileName, "Pokemon", "NationalDexNumber", "0")
SecondDexNumber = GetString(INIFileName, "Pokemon", "SecondDexNumber", "0")
If NationalDexNumber < (GetString(GetINIFileLocation(), header, "NumberOfDexEntries", "")) And NationalDexNumber <> 0 Then
If Int32.Parse(NationalDexNumber) < Int32.Parse(GetString(GetINIFileLocation(), header, "NumberOfDexEntries", "")) And NationalDexNumber <> 0 Then
PokedexDescription = Asc2Sapp(GetString(INIFileName, "Pokemon", "PokedexDescription", "Description\x")) & " "
Hght = GetString(INIFileName, "Pokemon", "Hght", "1")
Wght = GetString(INIFileName, "Pokemon", "Wght", "1")
@ -138,9 +138,28 @@ Module ImportDataFunctions
WriteHEX(LoadedROM, (Int32.Parse((GetString(GetINIFileLocation(), header, "PokemonEvolutions", "")), System.Globalization.NumberStyles.HexNumber)) + ((PokemonIndex) * (8 * (GetString(GetINIFileLocation(), header, "NumberOfEvolutionsPerPokemon", "")))), EvolutionData)
lvlupattacksoffset = SearchFreeSpaceFourAligned(LoadedROM, &HFF, ((Len(lvlupattacks) / 2)), "&H" & GetString(GetINIFileLocation(), header, "StartSearchingForSpaceOffset", "800000"))
Dim alreadyInsertedAtk As Boolean = False
If Pokemonedit.CheckBox1.Checked Then
If Pokemonedit.AtkStrings.Count > 0 Then
Dim countNum As Integer = 0
For Each oldAtk As String In Pokemonedit.AtkStrings
If String.Compare(lvlupattacks, oldAtk) = 0 Then
alreadyInsertedAtk = True
lvlupattacksoffset = Pokemonedit.AtkOffsets(countNum)
Exit For
End If
WriteHEX(LoadedROM, lvlupattacksoffset, lvlupattacks)
countNum += 1
Next
End If
End If
If Not alreadyInsertedAtk Then
lvlupattacksoffset = SearchFreeSpaceFourAligned(LoadedROM, &HFF, ((Len(lvlupattacks) / 2)), "&H" & GetString(GetINIFileLocation(), header, "StartSearchingForSpaceOffset", "800000"))
Pokemonedit.AtkStrings.Add(lvlupattacks)
Pokemonedit.AtkOffsets.Add(lvlupattacksoffset)
WriteHEX(LoadedROM, lvlupattacksoffset, lvlupattacks)
End If
WriteHEX(LoadedROM, (Int32.Parse((GetString(GetINIFileLocation(), header, "PokemonAttackTable", "")), System.Globalization.NumberStyles.HexNumber)) + (PokemonIndex * 4), ReverseHEX(Hex(((lvlupattacksoffset)) + &H8000000)))
@ -150,7 +169,7 @@ Module ImportDataFunctions
WriteHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "TMHMCompatibility", "")), System.Globalization.NumberStyles.HexNumber) + (PokemonIndex * (Val(GetString(GetINIFileLocation(), header, "TMHMLenPerPoke", "")))), TMHMCompatibility)
If NationalDexNumber < (GetString(GetINIFileLocation(), header, "NumberOfDexEntries", "")) And NationalDexNumber <> 0 Then
If Int32.Parse(NationalDexNumber) < Int32.Parse(GetString(GetINIFileLocation(), header, "NumberOfDexEntries", "")) And NationalDexNumber <> 0 Then
If header2 = "AXP" Or header2 = "AXV" Then
@ -196,16 +215,36 @@ Module ImportDataFunctions
WriteHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexData", "")), System.Globalization.NumberStyles.HexNumber) + 26 + (NationalDexNumber * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Scale2), 4)))
WriteHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexData", "")), System.Globalization.NumberStyles.HexNumber) + 28 + (NationalDexNumber * SkipVar), ReverseHEX(VB.Right("0000" & Hex(Offset_2), 4)))
Dim alreadyInserted As Boolean = False
If Pokemonedit.CheckBox1.Checked Then
Dim countNum As Integer = 0
If Pokemonedit.DexDescps.Count > 0 Then
For Each desc As String In Pokemonedit.DexDescps
If String.Compare(PokedexDescription, desc) = 0 Then
alreadyInserted = True
PokedexDescriptionOff = Pokemonedit.DexOffsets(countNum)
End If
PokedexDescriptionOff = SearchFreeSpaceFourAligned(LoadedROM, &HFF, (Len(PokedexDescription)), "&H" & GetString(GetINIFileLocation(), header, "StartSearchingForSpaceOffset", "800000"))
countNum += 1
Next
End If
End If
FileNum = FreeFile()
FileOpen(FileNum, LoadedROM, OpenMode.Binary)
If Not alreadyInserted Then
PokedexDescriptionOff = SearchFreeSpaceFourAligned(LoadedROM, &HFF, (Len(PokedexDescription)), "&H" & GetString(GetINIFileLocation(), header, "StartSearchingForSpaceOffset", "800000"))
FilePut(FileNum, PokedexDescription, ("&H" & Hex(PokedexDescriptionOff)) + 1, False)
Pokemonedit.DexDescps.Add(PokedexDescription)
Pokemonedit.DexOffsets.Add(PokedexDescriptionOff)
FileClose(FileNum)
FileNum = FreeFile()
FileOpen(FileNum, LoadedROM, OpenMode.Binary)
FilePut(FileNum, PokedexDescription, ("&H" & Hex(PokedexDescriptionOff)) + 1, False)
FileClose(FileNum)
End If
WriteHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexData", "")), System.Globalization.NumberStyles.HexNumber) + 4 + 12 + (NationalDexNumber * SkipVar), ReverseHEX(Hex(Val("&H" & (Hex(PokedexDescriptionOff))) + &H8000000)))
@ -427,12 +466,12 @@ Module ImportDataFunctions
Dim palcolor As Color
Dim flag As Boolean = False
Array.Clear(FrontPalette, 0, &H10 - 1)
Array.Clear(BackPalette, 0, &H10 - 1)
Array.Clear(FrontPalette, 0, &H10)
Array.Clear(BackPalette, 0, &H10)
If LoadAnimationFlag = True Then
Array.Clear(AnimationNormalPalette, 0, &H10 - 1)
Array.Clear(AnimationShinyPalette, 0, &H10 - 1)
Array.Clear(AnimationNormalPalette, 0, &H10)
Array.Clear(AnimationShinyPalette, 0, &H10)
End If
@ -552,21 +591,31 @@ Module ImportDataFunctions
ConvertBitmapToPalette(OShinyBackBitmapAnimation, AnimationShinyPalette, True)
End If
SynchSprite(BackSprite, ONormalBackBitmap, OShinyBackBitmap)
Try
SynchSprite(BackSprite, ONormalBackBitmap, OShinyBackBitmap)
Catch
SynchSpriteOverflow(BackSprite, ONormalBackBitmap, OShinyBackBitmap)
End Try
If LoadAnimationFlag = True Then
SynchSprite(AnimationNormalSprite, ONormalFrontBitmapAnimation, OShinyFrontBitmapAnimation)
Try
SynchSprite2(AnimationNormalSprite, ONormalFrontBitmapAnimation, OShinyFrontBitmapAnimation)
Catch
SynchSprite2Overflow(AnimationNormalSprite, ONormalFrontBitmapAnimation, OShinyFrontBitmapAnimation)
End Try
SaveAnimationSpriteToFreeSpace(PokemonIndex, AnimationNormalSprite)
Else
SynchSprite(FrontSprite, ONormalFrontBitmap, OShinyFrontBitmap)
Try
SynchSprite(FrontSprite, ONormalFrontBitmap, OShinyFrontBitmap)
Catch
SynchSpriteOverflow(FrontSprite, ONormalFrontBitmap, OShinyFrontBitmap)
End Try
SaveFrontSpriteToFreeSpace(PokemonIndex, FrontSprite, FrontPalette)
End If
mainbitmap.Dispose()
SaveBackSpriteToFreeSpace(PokemonIndex, BackSprite, BackPalette)
End Sub
Private Sub SynchSprite(ByRef SpriteArray As Byte(), ByRef NormalSprite As Bitmap, ByRef ShinySprite As Bitmap)
@ -647,9 +696,85 @@ Module ImportDataFunctions
Loop
End Sub
Public Sub ImportPokemonIcon(filename As String, PokemonIndex As Integer)
Private Sub SynchSpriteOverflow(ByRef SpriteArray As Byte(), ByRef NormalSprite As Bitmap, ByRef ShinySprite As Bitmap)
Dim num11 As Double = ((CDbl(SpriteArray.Length) / 256) - 1)
Dim i As Double = 0
Do While (i <= num11)
Dim num8 As Integer = 0
Do
Dim num9 As Integer = 0
Do
Dim num10 As Integer = 0
Do
Dim num3 As Byte
Dim num4 As UInt32
Dim index As Byte = CByte(Array.IndexOf(Of Color)(FrontPalette, FrontPalette(GetClosestColorFromPalette(NormalSprite.GetPixel(((num8 * 8) + (num10 * 2)), CInt(Math.Round(CDbl(((i * 8) + num9))))), FrontPalette))))
Dim num2 As Byte = CByte(Array.IndexOf(Of Color)(FrontPalette, FrontPalette(GetClosestColorFromPalette(NormalSprite.GetPixel((((num8 * 8) + (num10 * 2)) + 1), CInt(Math.Round(CDbl(((i * 8) + num9))))), FrontPalette))))
Dim num5 As Byte = CByte(Array.IndexOf(Of Color)(BackPalette, BackPalette(GetClosestColorFromPalette(ShinySprite.GetPixel(((num8 * 8) + (num10 * 2)), CInt(Math.Round(CDbl(((i * 8) + num9))))), BackPalette))))
Dim num6 As Byte = CByte(Array.IndexOf(Of Color)(BackPalette, BackPalette(GetClosestColorFromPalette(ShinySprite.GetPixel((((num8 * 8) + (num10 * 2)) + 1), CInt(Math.Round(CDbl(((i * 8) + num9))))), BackPalette))))
If (num5 > index) Then
num3 = num5
Else
num3 = index
End If
If (num6 > num2) Then
num3 = CByte((num3 Or CByte((num6 << 4))))
Else
num3 = CByte((num3 Or CByte((num2 << 4))))
End If
SpriteArray(num4) = num3
Dim addvar As UInteger = 1
num4 = (num4 + addvar)
num10 += 1
Loop While (num10 <= 3)
num9 += 1
Loop While (num9 <= 7)
num8 += 1
Loop While (num8 <= 7)
i += 1
Loop
End Sub
Dim iconpals(2)() As Color
Private Sub SynchSprite2Overflow(ByRef SpriteArray As Byte(), ByRef NormalSprite As Bitmap, ByRef ShinySprite As Bitmap)
Dim num11 As Double = ((CDbl(SpriteArray.Length) / 256) - 1)
Dim i As Double = 0
Do While (i <= num11)
Dim num8 As Integer = 0
Do
Dim num9 As Integer = 0
Do
Dim num10 As Integer = 0
Do
Dim num3 As Byte
Dim num4 As UInt32
Dim index As Byte = CByte(Math.Abs(Array.IndexOf(Of Color)(AnimationNormalPalette, AnimationNormalPalette(GetClosestColorFromPalette(NormalSprite.GetPixel(((num8 * 8) + (num10 * 2)), CInt(Math.Round(CDbl(((i * 8) + num9))))), AnimationNormalPalette)))))
Dim num2 As Byte = CByte(Math.Abs(Array.IndexOf(Of Color)(AnimationNormalPalette, AnimationNormalPalette(GetClosestColorFromPalette(NormalSprite.GetPixel((((num8 * 8) + (num10 * 2)) + 1), CInt(Math.Round(CDbl(((i * 8) + num9))))), AnimationNormalPalette)))))
Dim num5 As Byte = CByte(Math.Abs(Array.IndexOf(Of Color)(AnimationShinyPalette, AnimationShinyPalette(GetClosestColorFromPalette(ShinySprite.GetPixel(((num8 * 8) + (num10 * 2)), CInt(Math.Round(CDbl(((i * 8) + num9))))), AnimationShinyPalette)))))
Dim num6 As Byte = CByte(Math.Abs(Array.IndexOf(Of Color)(AnimationShinyPalette, AnimationShinyPalette(GetClosestColorFromPalette(ShinySprite.GetPixel((((num8 * 8) + (num10 * 2)) + 1), CInt(Math.Round(CDbl(((i * 8) + num9))))), AnimationShinyPalette)))))
If (num5 > index) Then
num3 = num5
Else
num3 = index
End If
If (num6 > num2) Then
num3 = CByte((num3 Or CByte((num6 << 4))))
Else
num3 = CByte((num3 Or CByte((num2 << 4))))
End If
SpriteArray(num4) = num3
Dim addvar As UInteger = 1
num4 = (num4 + addvar)
num10 += 1
Loop While (num10 <= 3)
num9 += 1
Loop While (num9 <= 7)
num8 += 1
Loop While (num8 <= 7)
i += 1
Loop
End Sub
Public Sub ImportPokemonIcon(filename As String, PokemonIndex As Integer)
Dim importimg As New Bitmap(filename)
@ -667,21 +792,52 @@ Module ImportDataFunctions
Dim pOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "IconPals", ""), System.Globalization.NumberStyles.HexNumber)
Dim hexstring As String = ""
'Dim ImgNewOffset
'Dim ImgBytes As Byte()
'Dim ImgString As String
Dim individualPalettes As Boolean = False
Try
pOffset = Int32.Parse(GetString(GetINIFileLocation(), header, "IconPointerTable2", ""), System.Globalization.NumberStyles.HexNumber)
individualPalettes = True
Catch
End Try
Dim iconpals(Pokemonedit.IconPalCount - 1)() As Color
Using fs As New FileStream(LoadedROM, FileMode.Open, FileAccess.Read)
Using r As New BinaryReader(fs)
Dim indexvar As Integer = 0
fs.Position = sOffset
sOffset = r.ReadInt32 - &H8000000
fs.Position = pOffset
If Not individualPalettes Then
Dim indexvar As Integer = 0
fs.Position = pOffset
Do
iconpals(indexvar) = LoadPaletteFromROM(fs)
indexvar += 1
Loop While (indexvar <= 2)
Do
iconpals(indexvar) = LoadPaletteFromROM(fs)
indexvar += 1
Loop While (indexvar <= 2)
Else
Dim pTable As Integer = pOffset
Do
fs.Position = pTable + (8 * indexvar)
pOffset = r.ReadInt32 - &H8000000
fs.Position = pOffset
iconpals(indexvar) = LoadPaletteFromROM(fs)
indexvar += 1
Loop While (indexvar <= Pokemonedit.IconPalCount - 1)
End If
fs.Close()
r.Close()
@ -763,4 +919,405 @@ Module ImportDataFunctions
End Sub
Public Sub ImportPokemonIconNewOffset(filename As String, PokemonIndex As Integer)
Dim importimg As New Bitmap(filename)
If importimg.Height <> &H40 Or importimg.Width <> &H20 Then
MsgBox("Image dimensions must be 32 by 64! Aborting...")
Exit Sub
End If
Dim palval As Integer
Dim sOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "IconPointerTable", ""), System.Globalization.NumberStyles.HexNumber) + (PokemonIndex * 4)
Dim pOffset As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "IconPals", ""), System.Globalization.NumberStyles.HexNumber)
Dim hexstring As String = ""
Dim ImgNewOffset
'Dim ImgBytes As Byte()
'Dim ImgString As String
Dim individualPalettes As Boolean = False
Try
pOffset = Int32.Parse(GetString(GetINIFileLocation(), header, "IconPointerTable2", ""), System.Globalization.NumberStyles.HexNumber)
individualPalettes = True
Catch
End Try
Dim iconpals(Pokemonedit.IconPalCount - 1)() As Color
Using fs As New FileStream(LoadedROM, FileMode.Open, FileAccess.Read)
Using r As New BinaryReader(fs)
Dim indexvar As Integer = 0
If Not individualPalettes Then
fs.Position = pOffset
Do
iconpals(indexvar) = LoadPaletteFromROM(fs)
indexvar += 1
Loop While (indexvar <= 2)
Else
Dim pTable As Integer = pOffset
Do
fs.Position = pTable + (8 * indexvar)
pOffset = r.ReadInt32 - &H8000000
fs.Position = pOffset
iconpals(indexvar) = LoadPaletteFromROM(fs)
indexvar += 1
Loop While (indexvar <= Pokemonedit.IconPalCount - 1)
End If
fs.Close()
r.Close()
End Using
End Using
palval = GetClosestPalette(importimg, iconpals)
ConvertBitmapToPalette(importimg, iconpals(palval), True)
'ImgBytes = ConvertStringToByteArray(CompressLz77String(ConvertByteArrayToString(SaveBitmapToArray(importimg, iconpals(palval)))))
'ImgString = ByteArrayToHexString(ImgBytes)
hexstring = ByteArrayToHexString(SaveBitmapToArray(importimg, iconpals(palval)))
ImgNewOffset = SearchFreeSpaceFourAligned(LoadedROM, &HFF, ((Len(hexstring) / 2)), "&H" & GetString(GetINIFileLocation(), header, "B00000", "B00000"))
WriteHEX(LoadedROM, ImgNewOffset, hexstring)
WriteHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "IconPalTable", "")), System.Globalization.NumberStyles.HexNumber) + PokemonIndex, Hex(palval))
WriteHEX(LoadedROM, sOffset, ReverseHEX(Hex((ImgNewOffset) + &H8000000)))
End Sub
Public Sub ImportItem(DataPath As String, ItemIndex As Integer, Optional Individual As Boolean = False)
Dim iniPath As String = ""
If Not Individual Then
iniPath = DataPath & "\" & ItemIndex & ".ini"
Else
iniPath = DataPath
End If
Dim ItemBaseOff As String = Int32.Parse((GetString(GetINIFileLocation(), header, "ItemData", "")), System.Globalization.NumberStyles.HexNumber)
'If System.IO.File.Exists(iniPath) Then
Dim ItemName As String = INI.GetString(iniPath, "Item", "ItemName", "IniProblem")
Dim ItemText As String = INI.GetString(iniPath, "Item", "ItemText", "IniProblem")
Dim Price As String = INI.GetString(iniPath, "Item", "Price", "0")
Dim HoldEffect As String = INI.GetString(iniPath, "Item", "HoldEffect", "0")
Dim Value As String = INI.GetString(iniPath, "Item", "Value", "0")
Dim ItemDescp As String = INI.GetString(iniPath, "Item", "ItemDescp", "IniProblem\x")
Dim Mystery1 As String = INI.GetString(iniPath, "Item", "Mystery1", "0")
Dim Mystery2 As String = INI.GetString(iniPath, "Item", "Mystery2", "0")
Dim Pocket As String = INI.GetString(iniPath, "Item", "Pocket", "1")
Dim ItemType As String = INI.GetString(iniPath, "Item", "ItemType", "0")
Dim FieldUsagePointer As String = INI.GetString(iniPath, "Item", "FieldUsagePointer", "FE821")
Dim BattleUsagePointer As String = INI.GetString(iniPath, "Item", "BattleUsagePointer", "F8000000")
Dim BUText As String = INI.GetString(iniPath, "Item", "BUText", "0")
Dim ExtraParam As String = INI.GetString(iniPath, "Item", "ExtraParam", "00000000")
ChangeItemName(ItemIndex, ItemName)
'Description
Dim alreadyInserted As Boolean = False
Dim countNum As Integer = 0
Dim newtextoff As String = ""
If ItemEditor.itemDescs.Count > 0 Then
For Each desc As String In ItemEditor.itemDescs
If String.Compare(desc, ItemDescp) = 0 Then
alreadyInserted = True
newtextoff = ItemEditor.itemDescOffsets(countNum)
End If
countNum += 1
Next
End If
If Not alreadyInserted Then
ItemEditor.itemDescs.Add(ItemDescp)
Dim destowrite As String = Asc2Sapp(Replace(ItemDescp, vbCrLf, "\n") & "\x")
Dim DescpByteLength As Integer = ItemDescp.Length
DescpByteLength = ItemDescp.Length - (ItemDescp.Split("[").Length - 1) - (ItemDescp.Split("]").Length - 1) - 1
If DescpByteLength < 1 Then
DescpByteLength = (destowrite & " ").Length
'destowrite = Asc2Sapp(Replace("?????", vbCrLf, "\n") & "\x")
End If
newtextoff = SearchFreeSpaceFourAligned(LoadedROM, &HFF, DescpByteLength, "&H" & GetString(GetINIFileLocation(), header, "B00000", "B00000"))
ItemEditor.itemDescOffsets.Add(newtextoff)
FileNum = FreeFile()
FileOpen(FileNum, LoadedROM, OpenMode.Binary)
FilePut(FileNum, destowrite & " ", ("&H" & Hex(newtextoff)) + 1, False)
FileClose(FileNum)
End If
Dim ItemHex1 As String = ""
Dim ItemHex2 As String = ""
ItemHex1 += ReverseHEX(VB.Right("0000" & Hex(ItemIndex), 4))
ItemHex1 += ReverseHEX(VB.Right("0000" & Hex(Price), 4))
ItemHex1 += VB.Right("00" & Hex(HoldEffect), 2)
ItemHex1 += VB.Right("00" & Hex(Value), 2)
ItemHex1 += VB.Right("00000000" & ReverseHEX(Hex(Int32.Parse(((newtextoff))) + &H8000000)), 8)
ItemHex1 += VB.Right("00" & Hex(Mystery1), 2)
ItemHex1 += VB.Right("00" & Hex(Mystery2), 2)
ItemHex1 += VB.Right("00" & Hex(Pocket), 2)
ItemHex1 += VB.Right("00" & Hex(ItemType), 2)
ItemHex1 += VB.Right("00000000" & ReverseHEX(Hex(Int32.Parse(((FieldUsagePointer)), System.Globalization.NumberStyles.HexNumber) + &H8000000)), 8)
ItemHex1 += VB.Right("00" & Hex(BUText), 2)
'3 Bytes Skipped Over
ItemHex2 += VB.Right("00000000" & ReverseHEX(Hex(Int32.Parse(((BattleUsagePointer)), System.Globalization.NumberStyles.HexNumber) + &H8000000)), 8)
ItemHex2 += VB.Right("00000000" & ReverseHEX(ExtraParam), 8)
WriteHEX(LoadedROM, ((ItemBaseOff) + 14) + (ItemIndex * 44), ItemHex1) '(ItemBaseOff) + 14---32
' (ItemBaseOff) + 33---35
WriteHEX(LoadedROM, ((ItemBaseOff) + 36) + (ItemIndex * 44), ItemHex2) '(ItemBaseOff) + 36---43
End Sub
Public Sub ImportItemPicture(pngpath As String, ItemIndex As String, Optional Individual As Boolean = False)
'Dim ItemPalette As Color() = New Color(&H11 - 1) {}
Dim mainbitmap As New Bitmap(pngpath)
Dim ItemBitmap As Bitmap = New Bitmap(&H18, &H18)
Dim ItemPicDataOff As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "ItemIMGData", ""), System.Globalization.NumberStyles.HexNumber)
If mainbitmap.Height = 24 And mainbitmap.Width = 24 Then
Else
MsgBox("The dimensions of the file " & pngpath & " do not seem correct. Aborting...")
Exit Sub
End If
BitmapBLT(mainbitmap, ItemBitmap, 0, 0, 0, 0, &H18, &H18, Color.FromArgb(&HFF, 200, 200, &HA8))
Dim ItemPalette As Color() = GetBitmapPaletteNoLimit(ItemBitmap)
While ItemPalette.Count() > 16
Dim BufferPal As New List(Of Color)
For looper = 1 To ItemPalette.Count() - 1
BufferPal.Add(ItemPalette(looper))
Next
BufferPal = RemoveOneColor(BufferPal)
BufferPal.InsertRange(0, {ItemPalette(0)})
ItemPalette = BufferPal.ToArray()
End While
ConvertBitmapToPalette(ItemBitmap, ItemPalette, True)
While ItemPalette.Count < 16
Dim BufferList As List(Of Color) = ItemPalette.ToList()
BufferList.Add(Color.FromArgb(&HFFFFFF))
ItemPalette = BufferList.ToArray()
End While
Dim Sprite As Byte() = SaveBitmapToArray(ItemBitmap, ItemPalette)
Dim ImgString As String
Dim PalString As String
Dim ImgBytes As Byte()
Dim PalBytes As Byte()
Dim ImgNewOffset As String = ""
Dim PalNewOffset As String = ""
ImgBytes = ConvertStringToByteArray(CompressLz77String(ConvertByteArrayToString(Sprite)))
PalBytes = ConvertStringToByteArray(CompressLz77String(ConvertPaletteToString(ItemPalette)))
ImgString = ByteArrayToHexString(ImgBytes)
PalString = ByteArrayToHexString(PalBytes)
Dim alreadyInsertedPic As Boolean = False
If ItemEditor.itemPics.Count > 0 Then
Dim countNum As Integer = 0
For Each oldPic As String In ItemEditor.itemPics
If String.Compare(ImgString, oldPic) = 0 Then
alreadyInsertedPic = True
ImgNewOffset = ItemEditor.itemPicOffsets(countNum)
Exit For
End If
countNum += 1
Next
End If
Dim alreadyInsertedPal As Boolean = False
If ItemEditor.itemPals.Count > 0 Then
Dim countNum As Integer = 0
For Each oldPal As String In ItemEditor.itemPals
If String.Compare(PalString, oldPal) = 0 Then
alreadyInsertedPal = True
PalNewOffset = ItemEditor.itemPalOffsets(countNum)
Exit For
End If
countNum += 1
Next
End If
If Not alreadyInsertedPic Then
ImgNewOffset = Convert.ToInt32(SearchFreeSpaceFourAligned(LoadedROM, &HFF, ((Len(ImgString) / 2)), "&H" & GetString(GetINIFileLocation(), header, "B00000", "B00000")))
ItemEditor.itemPics.Add(ImgString)
ItemEditor.itemPicOffsets.Add(ImgNewOffset)
End If
WriteHEX(LoadedROM, Int32.Parse(ImgNewOffset), ImgString)
If Not alreadyInsertedPal Then
PalNewOffset = Convert.ToInt32(SearchFreeSpaceFourAligned(LoadedROM, &HFF, ((Len(PalString) / 2)), "&H" & GetString(GetINIFileLocation(), header, "B00000", "B00000")))
ItemEditor.itemPals.Add(PalString)
ItemEditor.itemPalOffsets.Add(PalNewOffset)
End If
WriteHEX(LoadedROM, Int32.Parse(PalNewOffset), PalString)
WriteHEX(LoadedROM, (ItemPicDataOff + (ItemIndex * 8)), ReverseHEX(Hex(Int32.Parse(((ImgNewOffset))) + &H8000000)))
WriteHEX(LoadedROM, (ItemPicDataOff + (ItemIndex * 8) + 4), ReverseHEX(Hex(Int32.Parse(((PalNewOffset))) + &H8000000)))
mainbitmap.Dispose()
End Sub
Public Function RemoveOneColor(pal As List(Of Color)) As List(Of Color)
RemoveOneColor = New List(Of Color)
Dim colorDiffs As List(Of List(Of Integer)) = New List(Of List(Of Integer))
Dim looper As Integer = 0
For col = 0 To pal.Count() - 1
Dim innerloop As Integer = 0
colorDiffs.Add(New List(Of Integer))
For innerCol = 0 To pal.Count() - 1
Dim testColDiff As Integer = 99999
If innerCol > col Then
If Not col = innerCol Then
testColDiff = GetColorDifference(pal(col), pal(innerCol))
End If
End If
colorDiffs(looper).Add(testColDiff)
innerloop += 1
Next
looper += 1
Next
looper = 0
Dim oldDiff As Integer = 99999
Dim colorsToCombine As Integer() = {0, 0}
For Each diffList As List(Of Integer) In colorDiffs
Dim innerloop As Integer = 0
For Each diff As Integer In diffList
If diff < oldDiff Then
oldDiff = diff
colorsToCombine = {looper, innerloop}
End If
innerloop += 1
Next
looper += 1
Next
pal.RemoveAt(colorsToCombine(1))
RemoveOneColor = pal
Return RemoveOneColor
End Function
Public Function GetLongString(ByVal strFilename As String, ByVal Section As String,
ByVal Key As String, ByVal [Default] As String) As String
GetLongString = ""
Dim intCharCount As Integer
Dim objResult As New System.Text.StringBuilder(1000)
intCharCount = GetPrivateProfileString(Section, Key,
[Default], objResult, objResult.Capacity, strFilename)
If intCharCount > 0 Then GetLongString =
Left(objResult.ToString, intCharCount)
'This should probably be commented out if used for another program!
If LoadedROM <> "" Then
If GetLongString = "" And GetINIFileLocation() = strFilename Then
OutPutError("Error! " & Key & " is missing for ROM " & Section & "!")
End If
End If
End Function
Private Declare Ansi Function GetPrivateProfileString _
Lib "kernel32.dll" Alias "GetPrivateProfileStringA" _
(ByVal lpApplicationName As String,
ByVal lpKeyName As String, ByVal lpDefault As String,
ByVal lpReturnedString As System.Text.StringBuilder,
ByVal nSize As Integer, ByVal lpFileName As String) _
As Integer
Public Sub ImportTutorMoves(filename)
Dim newMoves As String = GetLongString(filename, "TUTR", "TutorMoves", "")
Dim moveTable As Integer = Int32.Parse((GetString(GetINIFileLocation(), header, "MoveTutorAttacks", "")), System.Globalization.NumberStyles.HexNumber)
Dim looper As Integer = 0
Dim maxAtacks As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "NumberOfMoveTutorAttacks", "0"))
While newMoves.Length > looper * 4 And looper < maxAtacks
WriteHEX(LoadedROM, moveTable + (2 * looper), VB.Right("0000" & newMoves.Substring(looper * 4, 4), 4))
looper += 1
End While
End Sub
Public Sub ImportTMHMINI(Filepath As String)
Dim TMHMAttacks As Integer = Int32.Parse((GetString(GetINIFileLocation(), header, "TMData", "")), System.Globalization.NumberStyles.HexNumber)
WriteHEX(LoadedROM, TMHMAttacks, GetString(Filepath, "TMHM", "TMHMData", ""))
Dim TMList As String = GetLongString(Filepath, "TMHM", "TMHMData", "")
Dim LoopVar As Integer = 0
Dim LoopLength As Integer = 0
If TMHMEditor.CheckBox1.Checked Then
LoopLength = Int32.Parse((Val(GetString(GetINIFileLocation(), header, "TotalTMsPlusHMs", "")))) - 8
Else
LoopLength = Int32.Parse((Val(GetString(GetINIFileLocation(), header, "TotalTMsPlusHMs", ""))))
End If
While LoopVar < LoopLength And LoopVar + 4 < TMList.Length = True
If TMList.Length > (LoopVar * 4) Then
WriteHEX(LoadedROM, TMHMAttacks + LoopVar * 2, TMList.Substring(LoopVar * 4, 4))
Else
WriteHEX(LoadedROM, TMHMAttacks + LoopVar * 2, "0000")
End If
LoopVar += 1
End While
End Sub
End Module

View File

@ -65,10 +65,24 @@ Partial Class ItemEditor
Me.BUTextBox = New System.Windows.Forms.TextBox()
Me.Label15 = New System.Windows.Forms.Label()
Me.ExtParTxt = New System.Windows.Forms.TextBox()
Me.Button7 = New System.Windows.Forms.Button()
Me.Button5 = New System.Windows.Forms.Button()
Me.Button4 = New System.Windows.Forms.Button()
Me.Button3 = New System.Windows.Forms.Button()
Me.Button2 = New System.Windows.Forms.Button()
Me.Button1 = New System.Windows.Forms.Button()
Me.ProgressBar1 = New System.Windows.Forms.ProgressBar()
Me.GroupBox4 = New System.Windows.Forms.GroupBox()
Me.ComboBox2 = New System.Windows.Forms.ComboBox()
Me.ComboBox1 = New System.Windows.Forms.ComboBox()
Me.FolderBrowserDialog = New System.Windows.Forms.FolderBrowserDialog()
Me.SaveFileDialog = New System.Windows.Forms.SaveFileDialog()
Me.OpenFileDialog = New System.Windows.Forms.OpenFileDialog()
Me.GroupBox1.SuspendLayout()
Me.GroupBox2.SuspendLayout()
CType(Me.ItemImagePictureBox, System.ComponentModel.ISupportInitialize).BeginInit()
Me.GroupBox3.SuspendLayout()
Me.GroupBox4.SuspendLayout()
Me.SuspendLayout()
'
'GroupBox1
@ -464,7 +478,7 @@ Partial Class ItemEditor
'Label15
'
Me.Label15.AutoSize = True
Me.Label15.Location = New System.Drawing.Point(492, 198)
Me.Label15.Location = New System.Drawing.Point(492, 201)
Me.Label15.Name = "Label15"
Me.Label15.Size = New System.Drawing.Size(114, 17)
Me.Label15.TabIndex = 51
@ -472,16 +486,129 @@ Partial Class ItemEditor
'
'ExtParTxt
'
Me.ExtParTxt.Location = New System.Drawing.Point(495, 218)
Me.ExtParTxt.Location = New System.Drawing.Point(495, 220)
Me.ExtParTxt.Name = "ExtParTxt"
Me.ExtParTxt.Size = New System.Drawing.Size(110, 22)
Me.ExtParTxt.TabIndex = 52
'
'Button7
'
Me.Button7.Location = New System.Drawing.Point(136, 20)
Me.Button7.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4)
Me.Button7.Name = "Button7"
Me.Button7.Size = New System.Drawing.Size(108, 27)
Me.Button7.TabIndex = 66
Me.Button7.Text = "Export Image"
Me.Button7.UseVisualStyleBackColor = True
'
'Button5
'
Me.Button5.Location = New System.Drawing.Point(346, 20)
Me.Button5.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4)
Me.Button5.Name = "Button5"
Me.Button5.Size = New System.Drawing.Size(108, 27)
Me.Button5.TabIndex = 65
Me.Button5.Text = "Import Image"
Me.Button5.UseVisualStyleBackColor = True
'
'Button4
'
Me.Button4.Location = New System.Drawing.Point(18, 20)
Me.Button4.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4)
Me.Button4.Name = "Button4"
Me.Button4.Size = New System.Drawing.Size(111, 27)
Me.Button4.TabIndex = 64
Me.Button4.Text = "Export Ini"
Me.Button4.UseVisualStyleBackColor = True
'
'Button3
'
Me.Button3.Location = New System.Drawing.Point(461, 20)
Me.Button3.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4)
Me.Button3.Name = "Button3"
Me.Button3.Size = New System.Drawing.Size(111, 27)
Me.Button3.TabIndex = 63
Me.Button3.Text = "Import Ini"
Me.Button3.UseVisualStyleBackColor = True
'
'Button2
'
Me.Button2.Location = New System.Drawing.Point(461, 53)
Me.Button2.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(111, 27)
Me.Button2.TabIndex = 62
Me.Button2.Text = "Import Range"
Me.Button2.UseVisualStyleBackColor = True
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(18, 53)
Me.Button1.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(111, 27)
Me.Button1.TabIndex = 60
Me.Button1.Text = "Export Range"
Me.Button1.UseVisualStyleBackColor = True
'
'ProgressBar1
'
Me.ProgressBar1.Location = New System.Drawing.Point(17, 86)
Me.ProgressBar1.Margin = New System.Windows.Forms.Padding(3, 2, 3, 2)
Me.ProgressBar1.Name = "ProgressBar1"
Me.ProgressBar1.Size = New System.Drawing.Size(555, 24)
Me.ProgressBar1.TabIndex = 61
'
'GroupBox4
'
Me.GroupBox4.Controls.Add(Me.ComboBox2)
Me.GroupBox4.Controls.Add(Me.ComboBox1)
Me.GroupBox4.Controls.Add(Me.ProgressBar1)
Me.GroupBox4.Controls.Add(Me.Button7)
Me.GroupBox4.Controls.Add(Me.Button1)
Me.GroupBox4.Controls.Add(Me.Button5)
Me.GroupBox4.Controls.Add(Me.Button2)
Me.GroupBox4.Controls.Add(Me.Button4)
Me.GroupBox4.Controls.Add(Me.Button3)
Me.GroupBox4.Location = New System.Drawing.Point(33, 375)
Me.GroupBox4.Margin = New System.Windows.Forms.Padding(3, 2, 3, 2)
Me.GroupBox4.Name = "GroupBox4"
Me.GroupBox4.Padding = New System.Windows.Forms.Padding(3, 2, 3, 2)
Me.GroupBox4.Size = New System.Drawing.Size(591, 120)
Me.GroupBox4.TabIndex = 68
Me.GroupBox4.TabStop = False
Me.GroupBox4.Text = "Import/Export"
'
'ComboBox2
'
Me.ComboBox2.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems
Me.ComboBox2.FormattingEnabled = True
Me.ComboBox2.Location = New System.Drawing.Point(299, 54)
Me.ComboBox2.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4)
Me.ComboBox2.Name = "ComboBox2"
Me.ComboBox2.Size = New System.Drawing.Size(156, 24)
Me.ComboBox2.TabIndex = 68
'
'ComboBox1
'
Me.ComboBox1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems
Me.ComboBox1.FormattingEnabled = True
Me.ComboBox1.Location = New System.Drawing.Point(136, 54)
Me.ComboBox1.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4)
Me.ComboBox1.Name = "ComboBox1"
Me.ComboBox1.Size = New System.Drawing.Size(156, 24)
Me.ComboBox1.TabIndex = 2
'
'OpenFileDialog
'
Me.OpenFileDialog.FileName = "OpenFileDialog1"
'
'ItemEditor
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 16.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(661, 389)
Me.ClientSize = New System.Drawing.Size(661, 508)
Me.Controls.Add(Me.GroupBox4)
Me.Controls.Add(Me.ExtParTxt)
Me.Controls.Add(Me.Label15)
Me.Controls.Add(Me.BUTextBox)
@ -524,6 +651,7 @@ Partial Class ItemEditor
CType(Me.ItemImagePictureBox, System.ComponentModel.ISupportInitialize).EndInit()
Me.GroupBox3.ResumeLayout(False)
Me.GroupBox3.PerformLayout()
Me.GroupBox4.ResumeLayout(False)
Me.ResumeLayout(False)
Me.PerformLayout()
@ -571,4 +699,17 @@ Partial Class ItemEditor
Friend WithEvents Button6 As Button
Friend WithEvents Label15 As System.Windows.Forms.Label
Friend WithEvents ExtParTxt As System.Windows.Forms.TextBox
Friend WithEvents Button7 As Button
Friend WithEvents Button5 As Button
Friend WithEvents Button4 As Button
Friend WithEvents Button3 As Button
Friend WithEvents Button2 As Button
Friend WithEvents Button1 As Button
Friend WithEvents ProgressBar1 As ProgressBar
Friend WithEvents GroupBox4 As GroupBox
Friend WithEvents FolderBrowserDialog As FolderBrowserDialog
Friend WithEvents SaveFileDialog As SaveFileDialog
Friend WithEvents OpenFileDialog As OpenFileDialog
Friend WithEvents ComboBox2 As ComboBox
Friend WithEvents ComboBox1 As ComboBox
End Class

View File

@ -117,6 +117,18 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="FolderBrowserDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="SaveFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>248, 17</value>
</metadata>
<metadata name="OpenFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>428, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>66</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>

View File

@ -11,6 +11,13 @@ Public Class ItemEditor
Dim ItemPicDataOff As Integer
Dim CurrentItemDescripLength As Integer
Public Shared itemDescs As List(Of String)
Public Shared itemDescOffsets As List(Of String)
Public Shared itemPics As List(Of String)
Public Shared itemPicOffsets As List(Of String)
Public Shared itemPals As List(Of String)
Public Shared itemPalOffsets As List(Of String)
Private Sub ItemEditor_Load(sender As Object, e As EventArgs) Handles MyBase.Load
If header2 = "BPR" Or header2 = "BPG" Or header2 = "BPE" Then
@ -37,15 +44,28 @@ Public Class ItemEditor
LoopVar = 0
ItemListComboBox.Items.Clear()
ComboBox1.Items.Clear()
ComboBox2.Items.Clear()
While LoopVar < (GetString(GetINIFileLocation(), header, "NumberOfItems", "")) = True
ItemListComboBox.Items.Add(GetItemName(LoopVar))
ComboBox1.Items.Add(GetItemName(LoopVar))
ComboBox2.Items.Add(GetItemName(LoopVar))
LoopVar = LoopVar + 1
End While
ItemListComboBox.SelectedIndex = 0
ComboBox1.SelectedIndex = 1
ComboBox2.SelectedIndex = Int32.Parse(GetString(GetINIFileLocation(), header, "NumberOfItems", "")) - 1
itemDescs = New List(Of String)
itemDescOffsets = New List(Of String)
itemPics = New List(Of String)
itemPicOffsets = New List(Of String)
itemPals = New List(Of String)
itemPalOffsets = New List(Of String)
End Sub
@ -53,21 +73,23 @@ Public Class ItemEditor
ChangeNameTextBox.Text = GetItemName(ItemListComboBox.SelectedIndex)
IndexTextBox.Text = Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, ((ItemBaseOff) + 14) + (ItemListComboBox.SelectedIndex * 44), 2))), System.Globalization.NumberStyles.HexNumber)
PriceTextBox.Text = Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, ((ItemBaseOff) + 16) + (ItemListComboBox.SelectedIndex * 44), 2))), System.Globalization.NumberStyles.HexNumber)
HoldEffectTextBox.Text = Int32.Parse((((ReadHEX(LoadedROM, ((ItemBaseOff) + 18) + (ItemListComboBox.SelectedIndex * 44), 1)))), System.Globalization.NumberStyles.HexNumber)
ValueTextBox.Text = Int32.Parse((((ReadHEX(LoadedROM, ((ItemBaseOff) + 19) + (ItemListComboBox.SelectedIndex * 44), 1)))), System.Globalization.NumberStyles.HexNumber)
DescribPointTextBox.Text = Hex(Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, ((ItemBaseOff) + 20) + (ItemListComboBox.SelectedIndex * 44), 4))), System.Globalization.NumberStyles.HexNumber) - &H8000000)
MysteryValue1TextBox.Text = Int32.Parse((((ReadHEX(LoadedROM, ((ItemBaseOff) + 24) + (ItemListComboBox.SelectedIndex * 44), 1)))), System.Globalization.NumberStyles.HexNumber)
MysteryValue2TextBox.Text = Int32.Parse((((ReadHEX(LoadedROM, ((ItemBaseOff) + 25) + (ItemListComboBox.SelectedIndex * 44), 1)))), System.Globalization.NumberStyles.HexNumber)
PocketComboBox.SelectedIndex = Int32.Parse((((ReadHEX(LoadedROM, ((ItemBaseOff) + 26) + (ItemListComboBox.SelectedIndex * 44), 1)))), System.Globalization.NumberStyles.HexNumber)
TypeTextBox.Text = Int32.Parse((((ReadHEX(LoadedROM, ((ItemBaseOff) + 27) + (ItemListComboBox.SelectedIndex * 44), 1)))), System.Globalization.NumberStyles.HexNumber)
Dim ItemHex As String = ReadHEX(LoadedROM, ((ItemBaseOff) + 14) + (ItemListComboBox.SelectedIndex * 44), 30)
FieldUsagePTTextBox.Text = Hex(Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, ((ItemBaseOff) + 28) + (ItemListComboBox.SelectedIndex * 44), 4))), System.Globalization.NumberStyles.HexNumber) - &H8000000)
BattleUsagePTTextBox.Text = Hex(Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, ((ItemBaseOff) + 36) + (ItemListComboBox.SelectedIndex * 44), 4))), System.Globalization.NumberStyles.HexNumber) - &H8000000)
BUTextBox.Text = Int32.Parse((((ReadHEX(LoadedROM, ((ItemBaseOff) + 32) + (ItemListComboBox.SelectedIndex * 44), 1)))), System.Globalization.NumberStyles.HexNumber)
IndexTextBox.Text = Int32.Parse((ReverseHEX(ItemHex.Substring(0, 4))), System.Globalization.NumberStyles.HexNumber)
PriceTextBox.Text = Int32.Parse((ReverseHEX(ItemHex.Substring(4, 4))), System.Globalization.NumberStyles.HexNumber)
HoldEffectTextBox.Text = Int32.Parse((((ItemHex.Substring(8, 2)))), System.Globalization.NumberStyles.HexNumber)
ValueTextBox.Text = Int32.Parse((((ItemHex.Substring(10, 2)))), System.Globalization.NumberStyles.HexNumber)
DescribPointTextBox.Text = Hex(Int32.Parse((ReverseHEX(ItemHex.Substring(12, 8))), System.Globalization.NumberStyles.HexNumber) - &H8000000)
MysteryValue1TextBox.Text = Int32.Parse((((ItemHex.Substring(20, 2)))), System.Globalization.NumberStyles.HexNumber)
MysteryValue2TextBox.Text = Int32.Parse((((ItemHex.Substring(22, 2)))), System.Globalization.NumberStyles.HexNumber)
PocketComboBox.SelectedIndex = Int32.Parse((((ItemHex.Substring(24, 2)))), System.Globalization.NumberStyles.HexNumber)
TypeTextBox.Text = Int32.Parse((((ItemHex.Substring(26, 2)))), System.Globalization.NumberStyles.HexNumber)
ExtParTxt.Text = ReverseHEX(ReadHEX(LoadedROM, ((ItemBaseOff) + 40) + (ItemListComboBox.SelectedIndex * 44), 4))
FieldUsagePTTextBox.Text = Hex(Int32.Parse((ReverseHEX(ItemHex.Substring(28, 8))), System.Globalization.NumberStyles.HexNumber) - &H8000000)
BattleUsagePTTextBox.Text = Hex(Int32.Parse((ReverseHEX(ItemHex.Substring(44, 8))), System.Globalization.NumberStyles.HexNumber) - &H8000000)
BUTextBox.Text = Int32.Parse((((ItemHex.Substring(36, 2)))), System.Globalization.NumberStyles.HexNumber)
ExtParTxt.Text = ReverseHEX(ItemHex.Substring(52, 8))
FileNum = FreeFile()
FileOpen(FileNum, LoadedROM, OpenMode.Binary)
@ -99,42 +121,68 @@ Public Class ItemEditor
Private Sub SaveBttn_Click(sender As Object, e As EventArgs) Handles SaveBttn.Click
Dim listvar As Integer
Dim listvar As Integer = ItemListComboBox.SelectedIndex
Dim LoopVar As Integer
listvar = ItemListComboBox.SelectedIndex
ChangeItemName(listvar, ChangeNameTextBox.Text)
WriteHEX(LoadedROM, ((ItemBaseOff) + 14) + (listvar * 44), ReverseHEX(VB.Right("0000" & Hex(IndexTextBox.Text), 4)))
WriteHEX(LoadedROM, ((ItemBaseOff) + 16) + (listvar * 44), ReverseHEX(VB.Right("0000" & Hex(PriceTextBox.Text), 4)))
WriteHEX(LoadedROM, ((ItemBaseOff) + 18) + (listvar * 44), Hex(HoldEffectTextBox.Text))
WriteHEX(LoadedROM, ((ItemBaseOff) + 19) + (listvar * 44), Hex(ValueTextBox.Text))
Dim ItemHex1 As String = ""
Dim ItemHex2 As String = ""
Dim ItemHex3 As String = ""
WriteHEX(LoadedROM, ((ItemBaseOff) + 24) + (listvar * 44), Hex(MysteryValue1TextBox.Text))
WriteHEX(LoadedROM, ((ItemBaseOff) + 25) + (listvar * 44), Hex(MysteryValue2TextBox.Text))
WriteHEX(LoadedROM, ((ItemBaseOff) + 26) + (listvar * 44), Hex(PocketComboBox.SelectedIndex))
WriteHEX(LoadedROM, ((ItemBaseOff) + 27) + (listvar * 44), Hex(TypeTextBox.Text))
ItemHex1 += ReverseHEX(VB.Right("0000" & Hex(IndexTextBox.Text), 4))
ItemHex1 += ReverseHEX(VB.Right("0000" & Hex(PriceTextBox.Text), 4))
ItemHex1 += VB.Right("00" & Hex(HoldEffectTextBox.Text), 2)
ItemHex1 += VB.Right("00" & Hex(ValueTextBox.Text), 2)
'4 Bytes Skipped Over - Desc Pointer
ItemHex2 += VB.Right("00" & Hex(MysteryValue1TextBox.Text), 2)
ItemHex2 += VB.Right("00" & Hex(MysteryValue2TextBox.Text), 2)
ItemHex2 += VB.Right("00" & Hex(PocketComboBox.SelectedIndex), 2)
ItemHex2 += VB.Right("00" & Hex(TypeTextBox.Text), 2)
ItemHex2 += VB.Right("00000000" & ReverseHEX(Hex(Int32.Parse(((FieldUsagePTTextBox.Text)), System.Globalization.NumberStyles.HexNumber) + &H8000000)), 8)
ItemHex2 += VB.Right("00" & Hex(BUTextBox.Text), 2)
'3 Bytes Skipped Over
ItemHex3 += VB.Right("00000000" & ReverseHEX(Hex(Int32.Parse(((BattleUsagePTTextBox.Text)), System.Globalization.NumberStyles.HexNumber) + &H8000000)), 8)
ItemHex3 += VB.Right("00000000" & ReverseHEX(ExtParTxt.Text), 8)
WriteHEX(LoadedROM, ((ItemBaseOff) + 28) + (ItemListComboBox.SelectedIndex * 44), ReverseHEX(Hex(Int32.Parse(((FieldUsagePTTextBox.Text)), System.Globalization.NumberStyles.HexNumber) + &H8000000)))
WriteHEX(LoadedROM, ((ItemBaseOff) + 36) + (ItemListComboBox.SelectedIndex * 44), ReverseHEX(Hex(Int32.Parse(((BattleUsagePTTextBox.Text)), System.Globalization.NumberStyles.HexNumber) + &H8000000)))
WriteHEX(LoadedROM, ((ItemBaseOff) + 32) + (listvar * 44), Hex(BUTextBox.Text))
WriteHEX(LoadedROM, ((ItemBaseOff) + 14) + (listvar * 44), ItemHex1) '(ItemBaseOff) + 14---19
' (ItemBaseOff) + 20---23
WriteHEX(LoadedROM, ((ItemBaseOff) + 24) + (listvar * 44), ItemHex2) '(ItemBaseOff) + 24---32
' (ItemBaseOff) + 33---35
WriteHEX(LoadedROM, ((ItemBaseOff) + 36) + (listvar * 44), ItemHex3) '(ItemBaseOff) + 36---43
WriteHEX(LoadedROM, ((ItemBaseOff) + 40) + (ItemListComboBox.SelectedIndex * 44), ReverseHEX(ExtParTxt.Text))
'WriteHEX(LoadedROM, ((ItemBaseOff) + 14) + (listvar * 44), ReverseHEX(VB.Right("0000" & Hex(IndexTextBox.Text), 4)))
'WriteHEX(LoadedROM, ((ItemBaseOff) + 16) + (listvar * 44), ReverseHEX(VB.Right("0000" & Hex(PriceTextBox.Text), 4)))
'WriteHEX(LoadedROM, ((ItemBaseOff) + 18) + (listvar * 44), Hex(HoldEffectTextBox.Text))
'WriteHEX(LoadedROM, ((ItemBaseOff) + 19) + (listvar * 44), Hex(ValueTextBox.Text))
If header2 = "BPR" Or header2 = "BPG" Or header2 = "BPE" Then
'WriteHEX(LoadedROM, ((ItemBaseOff) + 24) + (listvar * 44), Hex(MysteryValue1TextBox.Text))
'WriteHEX(LoadedROM, ((ItemBaseOff) + 25) + (listvar * 44), Hex(MysteryValue2TextBox.Text))
'WriteHEX(LoadedROM, ((ItemBaseOff) + 26) + (listvar * 44), Hex(PocketComboBox.SelectedIndex))
'WriteHEX(LoadedROM, ((ItemBaseOff) + 27) + (listvar * 44), Hex(TypeTextBox.Text))
Else
'WriteHEX(LoadedROM, ((ItemBaseOff) + 28) + (ItemListComboBox.SelectedIndex * 44), ReverseHEX(Hex(Int32.Parse(((FieldUsagePTTextBox.Text)), System.Globalization.NumberStyles.HexNumber) + &H8000000)))
'WriteHEX(LoadedROM, ((ItemBaseOff) + 36) + (ItemListComboBox.SelectedIndex * 44), ReverseHEX(Hex(Int32.Parse(((BattleUsagePTTextBox.Text)), System.Globalization.NumberStyles.HexNumber) + &H8000000)))
'WriteHEX(LoadedROM, ((ItemBaseOff) + 32) + (listvar * 44), Hex(BUTextBox.Text))
End If
'WriteHEX(LoadedROM, ((ItemBaseOff) + 40) + (ItemListComboBox.SelectedIndex * 44), ReverseHEX(ExtParTxt.Text))
'If header2 = "BPR" Or header2 = "BPG" Or header2 = "BPE" Then
'Else
'End If
LoopVar = 0
ItemListComboBox.Items.Clear()
ComboBox1.Items.Clear()
ComboBox2.Items.Clear()
While LoopVar < (GetString(GetINIFileLocation(), header, "NumberOfItems", "")) = True
ItemListComboBox.Items.Add(GetItemName(LoopVar))
ComboBox1.Items.Add(GetItemName(LoopVar))
ComboBox2.Items.Add(GetItemName(LoopVar))
LoopVar = LoopVar + 1
@ -256,4 +304,313 @@ Public Class ItemEditor
End If
End Sub
Private Sub ExportAll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
FolderBrowserDialog.Description = "Select folder to export Items to:"
If FolderBrowserDialog.ShowDialog = Windows.Forms.DialogResult.OK Then
If ComboBox1.SelectedIndex > ComboBox2.SelectedIndex Then
Dim tempBox1 As Integer = ComboBox1.SelectedIndex
ComboBox1.SelectedIndex = ComboBox2.SelectedIndex
ComboBox2.SelectedIndex = tempBox1
End If
Me.Text = "Please wait..."
Me.UseWaitCursor = True
If System.IO.Directory.Exists(FolderBrowserDialog.SelectedPath & "\Items") = False Then
System.IO.Directory.CreateDirectory(FolderBrowserDialog.SelectedPath & "\Items")
End If
If System.IO.Directory.Exists(FolderBrowserDialog.SelectedPath & "\Items\ItemPics") = False Then
System.IO.Directory.CreateDirectory(FolderBrowserDialog.SelectedPath & "\Items\ItemPics")
End If
Dim LoopVar As Integer
LoopVar = ComboBox1.SelectedIndex - 1
Me.Enabled = False
ProgressBar1.Value = 0
While LoopVar < ComboBox2.SelectedIndex = True
' PKMNaItemImportExportss.SelectedIndex = LoopVar
LoopVar = LoopVar + 1
ExportItemINI(FolderBrowserDialog.SelectedPath, LoopVar)
ProgressBar1.Value = ((LoopVar - ComboBox1.SelectedIndex) / (ComboBox2.SelectedIndex - ComboBox1.SelectedIndex)) * 100
ProgressBar1.Invalidate()
ProgressBar1.Update()
End While
Me.Enabled = True
Me.UseWaitCursor = False
ProgressBar1.Value = 0
Me.BringToFront()
End If
End Sub
Private Sub ImportAll(sender As Object, e As EventArgs) Handles Button2.Click
Dim listvar As Integer = ItemListComboBox.SelectedIndex
FolderBrowserDialog.Description = "Select ini file to import Items from:"
If FolderBrowserDialog.ShowDialog = Windows.Forms.DialogResult.OK Then
If ComboBox1.SelectedIndex > ComboBox2.SelectedIndex Then
Dim tempBox1 As Integer = ComboBox1.SelectedIndex
ComboBox1.SelectedIndex = ComboBox2.SelectedIndex
ComboBox2.SelectedIndex = tempBox1
End If
Me.Text = "Please wait..."
Me.UseWaitCursor = True
ProgressBar1.Value = 0
Dim LoopVar As Integer
LoopVar = ComboBox1.SelectedIndex - 1
Me.Enabled = False
While LoopVar < ComboBox2.SelectedIndex = True
'While LoopVar < (GetString(GetINIFileLocation(), header, "NumberOfItems", "")) - 2 = True
LoopVar = LoopVar + 1
If LoopVar = 377 Then
LoopVar = 378
If LoopVar < ComboBox2.SelectedIndex Then
Exit While
End If
End If
If System.IO.File.Exists(FolderBrowserDialog.SelectedPath & "\" & LoopVar & ".ini") Then
ImportItem(FolderBrowserDialog.SelectedPath, LoopVar)
ElseIf System.IO.File.Exists(FolderBrowserDialog.SelectedPath & "\" & VB.Right("000" & LoopVar, 3) & ".ini") And LoopVar < 1000 Then
ImportItem(FolderBrowserDialog.SelectedPath, LoopVar)
End If
If System.IO.File.Exists(FolderBrowserDialog.SelectedPath & "\ItemPics\" & LoopVar & ".png") Then
ImportItemPicture(FolderBrowserDialog.SelectedPath & "\ItemPics\" & LoopVar & ".png", LoopVar)
ElseIf System.IO.File.Exists(FolderBrowserDialog.SelectedPath & "\ItemPics\" & VB.Right("000" & LoopVar, 3) & ".png") And LoopVar < 1000 Then
ImportItemPicture(FolderBrowserDialog.SelectedPath & "\ItemPics\" & VB.Right("000" & LoopVar, 3) & ".png", LoopVar)
End If
ProgressBar1.Value = ((LoopVar - ComboBox1.SelectedIndex) / (ComboBox2.SelectedIndex - ComboBox1.SelectedIndex)) * 100
ProgressBar1.Invalidate()
ProgressBar1.Update()
'If CheckBox1.Checked And LoopVar = 346 Then
'LoopVar = 377
'End If
End While
'ItemImportExports.WriteNewFile(Convert.ToString(ItemImportExports.romString))
ItemListComboBox.SelectedIndex = 1
ItemListComboBox.SelectedIndex = 0
Me.UseWaitCursor = False
ProgressBar1.Value = 0
Me.BringToFront()
RefreshItems(listvar)
End If
Me.Text = "Item Editor"
Me.Enabled = True
Me.BringToFront()
End Sub
Private Sub ExportSingleItem(sender As Object, e As EventArgs) Handles Button4.Click
Dim listvar As Integer = ItemListComboBox.SelectedIndex
SaveFileDialog.FileName = (listvar) & ".ini"
'SaveFileDialog.CheckFileExists = True
' Check to ensure that the selected path exists. Dialog box displays
' a warning otherwise.
SaveFileDialog.CheckPathExists = True
' Get or set default extension. Doesn't include the leading ".".
SaveFileDialog.DefaultExt = "ini"
' Return the file referenced by a link? If False, simply returns the selected link
' file. If True, returns the file linked to the LNK file.
SaveFileDialog.DereferenceLinks = True
' Just as in VB6, use a set of pairs of filters, separated with "|". Each
' pair consists of a description|file spec. Use a "|" between pairs. No need to put a
' trailing "|". You can set the FilterIndex property as well, to select the default
' filter. The first filter is numbered 1 (not 0). The default is 1.
SaveFileDialog.Filter =
"(*.ini)|*.ini*"
'SaveFileDialog.Multiselect = False
' Restore the original directory when done selecting
' a file? If False, the current directory changes
' to the directory in which you selected the file.
' Set this to True to put the current folder back
' where it was when you started.
' The default is False.
'.RestoreDirectory = False
' Show the Help button and Read-Only checkbox?
SaveFileDialog.ShowHelp = False
'SaveFileDialog.ShowReadOnly = False
' Start out with the read-only check box checked?
' This only make sense if ShowReadOnly is True.
'SaveFileDialog.ReadOnlyChecked = False
SaveFileDialog.Title = "Save as"
SaveFileDialog.ValidateNames = True
If SaveFileDialog.ShowDialog = Windows.Forms.DialogResult.OK Then
Me.Text = "Please wait..."
Me.UseWaitCursor = True
ExportItemINI(SaveFileDialog.FileName, listvar, True)
Me.UseWaitCursor = False
Me.Enabled = True
End If
RefreshItems(listvar)
End Sub
Private Sub RefreshItems(listvar)
Dim LoopVar As Integer = 0
ItemListComboBox.Items.Clear()
ComboBox1.Items.Clear()
ComboBox2.Items.Clear()
While LoopVar < (GetString(GetINIFileLocation(), header, "NumberOfItems", "") - 1) = True
ItemListComboBox.Items.Add(GetItemName(LoopVar))
ComboBox1.Items.Add(GetItemName(LoopVar))
ComboBox2.Items.Add(GetItemName(LoopVar))
LoopVar = LoopVar + 1
End While
ItemListComboBox.SelectedIndex = listvar
End Sub
Private Sub ExportSinglePicture(sender As Object, e As EventArgs) Handles Button7.Click
Dim listvar As Integer = ItemListComboBox.SelectedIndex
SaveFileDialog.FileName = (listvar) & ".png"
'SaveFileDialog.CheckFileExists = True
' Check to ensure that the selected path exists. Dialog box displays
' a warning otherwise.
SaveFileDialog.CheckPathExists = True
' Get or set default extension. Doesn't include the leading ".".
SaveFileDialog.DefaultExt = "ini"
' Return the file referenced by a link? If False, simply returns the selected link
' file. If True, returns the file linked to the LNK file.
SaveFileDialog.DereferenceLinks = True
' Just as in VB6, use a set of pairs of filters, separated with "|". Each
' pair consists of a description|file spec. Use a "|" between pairs. No need to put a
' trailing "|". You can set the FilterIndex property as well, to select the default
' filter. The first filter is numbered 1 (not 0). The default is 1.
SaveFileDialog.Filter =
"(*.png)|*.png*"
'SaveFileDialog.Multiselect = False
' Restore the original directory when done selecting
' a file? If False, the current directory changes
' to the directory in which you selected the file.
' Set this to True to put the current folder back
' where it was when you started.
' The default is False.
'.RestoreDirectory = False
' Show the Help button and Read-Only checkbox?
SaveFileDialog.ShowHelp = False
'SaveFileDialog.ShowReadOnly = False
' Start out with the read-only check box checked?
' This only make sense if ShowReadOnly is True.
'SaveFileDialog.ReadOnlyChecked = False
SaveFileDialog.Title = "Save as"
SaveFileDialog.ValidateNames = True
If SaveFileDialog.ShowDialog = Windows.Forms.DialogResult.OK Then
Me.Text = "Please wait..."
Me.UseWaitCursor = True
ExportItemPicture(SaveFileDialog.FileName, listvar)
Me.UseWaitCursor = False
Me.Enabled = True
End If
RefreshItems(listvar)
End Sub
Private Sub ImportSinglePicture(sender As Object, e As EventArgs) Handles Button5.Click
Dim listvar As Integer = ItemListComboBox.SelectedIndex
OpenFileDialog.Title = "Select Image to import"
' Only accept valid Win32 file names?
OpenFileDialog.ValidateNames = False
If Not OpenFileDialog.FileName.Contains(".png") Then
OpenFileDialog.FileName = OpenFileDialog.FileName & ".png"
End If
If OpenFileDialog.ShowDialog = Windows.Forms.DialogResult.OK Then
Me.Text = "Please wait..."
Me.UseWaitCursor = True
ImportItemPicture(OpenFileDialog.FileName, listvar, True)
Me.UseWaitCursor = False
Me.Enabled = True
End If
RefreshItems(listvar)
End Sub
Private Sub ImportSingleItem(sender As Object, e As EventArgs) Handles Button3.Click
Dim listvar As Integer = ItemListComboBox.SelectedIndex
OpenFileDialog.Title = "Select Item to import"
' Only accept valid Win32 file names?
OpenFileDialog.ValidateNames = True
If OpenFileDialog.ShowDialog = Windows.Forms.DialogResult.OK Then
Me.Text = "Please wait..."
Me.UseWaitCursor = True
ImportItem(OpenFileDialog.FileName, listvar, True)
Me.UseWaitCursor = False
Me.Enabled = True
End If
RefreshItems(listvar)
End Sub
End Class

View File

@ -396,7 +396,8 @@ Public Class MainFrm
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
'Me.Visible = False
Me.Cursor = Cursors.WaitCursor
movetutor2.Show()
MoveTutorEditor.Show()
MoveTutorEditor.BringToFront()
Me.Cursor = Cursors.Arrow
End Sub
@ -404,6 +405,7 @@ Public Class MainFrm
'Me.Visible = False
Me.Cursor = Cursors.WaitCursor
PokedexOrderEditor.Show()
PokedexOrderEditor.BringToFront()
Me.Cursor = Cursors.Arrow
End Sub
@ -411,6 +413,7 @@ Public Class MainFrm
' Me.Visible = False
Me.Cursor = Cursors.WaitCursor
Pokemonedit.Show()
Pokemonedit.BringToFront()
Me.Cursor = Cursors.Arrow
End Sub
@ -437,6 +440,7 @@ Public Class MainFrm
Me.Cursor = Cursors.WaitCursor
'Me.Visible = False
AttackEditor.Show()
AttackEditor.BringToFront()
Me.Cursor = Cursors.Arrow
End Sub
@ -446,6 +450,7 @@ Public Class MainFrm
'Me.Visible = False
Me.Cursor = Cursors.WaitCursor
AbilityEdit.Show()
AbilityEdit.BringToFront()
Me.Cursor = Cursors.Arrow
End Sub
@ -554,6 +559,7 @@ Public Class MainFrm
'Me.Visible = False
Me.Cursor = Cursors.WaitCursor
RSEStarterEditor.Show()
RSEStarterEditor.BringToFront()
Me.Cursor = Cursors.Arrow
End Sub
@ -561,6 +567,7 @@ Public Class MainFrm
'Me.Visible = False
Me.Cursor = Cursors.WaitCursor
PokedexDataEditor.Show()
PokedexDataEditor.BringToFront()
Me.Cursor = Cursors.Arrow
End Sub
@ -569,6 +576,7 @@ Public Class MainFrm
'Me.Visible = False
Me.Cursor = Cursors.WaitCursor
BattleFrontierEditor.Show()
BattleFrontierEditor.BringToFront()
Me.Cursor = Cursors.Arrow
End Sub

View File

@ -1,5 +1,5 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class movetutor2
Partial Class MoveTutorEditor
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
@ -22,17 +22,22 @@ Partial Class movetutor2
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(movetutor2))
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(MoveTutorEditor))
Me.Button2 = New System.Windows.Forms.Button()
Me.Combo1 = New System.Windows.Forms.ComboBox()
Me.ListBox1 = New System.Windows.Forms.ListBox()
Me.Button3 = New System.Windows.Forms.Button()
Me.Button1 = New System.Windows.Forms.Button()
Me.fileOpenDialog = New System.Windows.Forms.OpenFileDialog()
Me.SaveFileDialog = New System.Windows.Forms.SaveFileDialog()
Me.SuspendLayout()
'
'Button2
'
Me.Button2.Location = New System.Drawing.Point(55, 179)
Me.Button2.Location = New System.Drawing.Point(86, 275)
Me.Button2.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(121, 25)
Me.Button2.Size = New System.Drawing.Size(176, 38)
Me.Button2.TabIndex = 16
Me.Button2.Text = "Save"
Me.Button2.UseVisualStyleBackColor = True
@ -41,31 +46,59 @@ Partial Class movetutor2
'
Me.Combo1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems
Me.Combo1.FormattingEnabled = True
Me.Combo1.Location = New System.Drawing.Point(54, 152)
Me.Combo1.Location = New System.Drawing.Point(86, 234)
Me.Combo1.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.Combo1.Name = "Combo1"
Me.Combo1.Size = New System.Drawing.Size(121, 21)
Me.Combo1.Size = New System.Drawing.Size(176, 28)
Me.Combo1.TabIndex = 0
'
'ListBox1
'
Me.ListBox1.FormattingEnabled = True
Me.ListBox1.Location = New System.Drawing.Point(55, 12)
Me.ListBox1.ItemHeight = 20
Me.ListBox1.Location = New System.Drawing.Point(86, 18)
Me.ListBox1.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.ListBox1.Name = "ListBox1"
Me.ListBox1.Size = New System.Drawing.Size(120, 134)
Me.ListBox1.Size = New System.Drawing.Size(176, 204)
Me.ListBox1.TabIndex = 16
'
'movetutor2
'Button3
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.Button3.Location = New System.Drawing.Point(269, 58)
Me.Button3.Name = "Button3"
Me.Button3.Size = New System.Drawing.Size(75, 33)
Me.Button3.TabIndex = 20
Me.Button3.Text = "Export"
Me.Button3.UseVisualStyleBackColor = True
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(4, 58)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(75, 33)
Me.Button1.TabIndex = 19
Me.Button1.Text = "Import"
Me.Button1.UseVisualStyleBackColor = True
'
'fileOpenDialog
'
Me.fileOpenDialog.FileName = "OpenFileDialog1"
'
'MoveTutorEditor
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(9.0!, 20.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(232, 212)
Me.ClientSize = New System.Drawing.Size(348, 326)
Me.Controls.Add(Me.Button3)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.ListBox1)
Me.Controls.Add(Me.Button2)
Me.Controls.Add(Me.Combo1)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.MaximizeBox = False
Me.Name = "movetutor2"
Me.Name = "MoveTutorEditor"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "Move Tutor Editor"
Me.ResumeLayout(False)
@ -74,4 +107,8 @@ Partial Class movetutor2
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents Combo1 As System.Windows.Forms.ComboBox
Friend WithEvents ListBox1 As ListBox
Friend WithEvents Button3 As Button
Friend WithEvents Button1 As Button
Friend WithEvents fileOpenDialog As OpenFileDialog
Friend WithEvents SaveFileDialog As SaveFileDialog
End Class

View File

@ -117,6 +117,12 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="fileOpenDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="SaveFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>201, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>

View File

@ -0,0 +1,208 @@
Option Strict Off
Option Explicit Off
Imports VB = Microsoft.VisualBasic
Public Class MoveTutorEditor
Dim Offset As Integer
'Dim Offset2 As Long
Private Sub movetutor2_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.Cursor = Cursors.WaitCursor
If header2 = "BPR" Or header2 = "BPG" Or header2 = "BPE" Then
Offset = Int32.Parse((GetString(GetINIFileLocation(), header, "MoveTutorAttacks", "")), System.Globalization.NumberStyles.HexNumber)
Dim loopything As String = 0
Dim curattack As String
Combo1.Items.Clear() 'Clears the combo boxes
While loopything < (Val(GetString(GetINIFileLocation(), header, "NumberOfAttacks", "")) + 1)
curattack = GetAttackName(loopything)
Combo1.Items.Add(curattack) 'adds the attacks to the comboboxes
loopything = loopything + 1
End While
loopything = 0
ListBox1.Items.Clear()
While loopything < (Val(GetString(GetINIFileLocation(), header, "NumberOfMoveTutorAttacks", "")))
ListBox1.Items.Add(GetAttackName(Int32.Parse(((ReverseHEX(ReadHEX(LoadedROM, Offset + (2 * loopything), 2)))), System.Globalization.NumberStyles.HexNumber)))
loopything = loopything + 1
End While
Me.Cursor = Cursors.Arrow
ListBox1.SelectedIndex = 0
Else
'If the ROM is not supported this code will run
Combo1.Enabled = False
Button2.Enabled = False
Combo1.Items.Clear() 'Clears the combo boxes
MsgBox("Unsupported ROM!")
'Lets the person know the ROM isn't supported.
End
End If
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim indexbuff As Integer
indexbuff = ListBox1.SelectedIndex
WriteHEX(LoadedROM, Offset + (2 * ListBox1.SelectedIndex), ReverseHEX(VB.Right("0000" & Hex(Combo1.SelectedIndex), 4)))
Dim loopything As String = 0
ListBox1.Items.Clear()
While loopything < (Val(GetString(GetINIFileLocation(), header, "NumberOfMoveTutorAttacks", "")))
ListBox1.Items.Add(GetAttackName(Int32.Parse(((ReverseHEX(ReadHEX(LoadedROM, Offset + (2 * loopything), 2)))), System.Globalization.NumberStyles.HexNumber)))
loopything = loopything + 1
End While
Me.Cursor = Cursors.Arrow
ListBox1.SelectedIndex = indexbuff
End Sub
Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox1.SelectedIndexChanged
Combo1.SelectedIndex = ((Int32.Parse(((ReverseHEX(ReadHEX(LoadedROM, Offset + (2 * ListBox1.SelectedIndex), 2)))), System.Globalization.NumberStyles.HexNumber)))
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
fileOpenDialog.FileName = ""
fileOpenDialog.CheckFileExists = True
' Check to ensure that the selected path exists. Dialog box displays
' a warning otherwise.
fileOpenDialog.CheckPathExists = True
' Get or set default extension. Doesn't include the leading ".".
fileOpenDialog.DefaultExt = "ini"
' Return the file referenced by a link? If False, simply returns the selected link
' file. If True, returns the file linked to the LNK file.
fileOpenDialog.DereferenceLinks = True
' Just as in VB6, use a set of pairs of filters, separated with "|". Each
' pair consists of a description|file spec. Use a "|" between pairs. No need to put a
' trailing "|". You can set the FilterIndex property as well, to select the default
' filter. The first filter is numbered 1 (not 0). The default is 1.
fileOpenDialog.Filter =
"(*.ini)|*.ini*"
fileOpenDialog.Multiselect = False
' Restore the original directory when done selecting
' a file? If False, the current directory changes
' to the directory in which you selected the file.
' Set this to True to put the current folder back
' where it was when you started.
' The default is False.
'.RestoreDirectory = False
' Show the Help button and Read-Only checkbox?
fileOpenDialog.ShowHelp = False
fileOpenDialog.ShowReadOnly = False
' Start out with the read-only check box checked?
' This only make sense if ShowReadOnly is True.
fileOpenDialog.ReadOnlyChecked = False
fileOpenDialog.Title = "Select ini file to import"
' Only accept valid Win32 file names?
fileOpenDialog.ValidateNames = True
If fileOpenDialog.ShowDialog = Windows.Forms.DialogResult.OK Then
ImportTutorMoves(fileOpenDialog.FileName)
movetutor2_Load(Me, EventArgs.Empty)
End If
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
SaveFileDialog.FileName = "TutorMoves.ini"
'SaveFileDialog.CheckFileExists = True
' Check to ensure that the selected path exists. Dialog box displays
' a warning otherwise.
SaveFileDialog.CheckPathExists = True
' Get or set default extension. Doesn't include the leading ".".
SaveFileDialog.DefaultExt = "ini"
' Return the file referenced by a link? If False, simply returns the selected link
' file. If True, returns the file linked to the LNK file.
SaveFileDialog.DereferenceLinks = True
' Just as in VB6, use a set of pairs of filters, separated with "|". Each
' pair consists of a description|file spec. Use a "|" between pairs. No need to put a
' trailing "|". You can set the FilterIndex property as well, to select the default
' filter. The first filter is numbered 1 (not 0). The default is 1.
SaveFileDialog.Filter =
"(*.ini)|*.ini*"
'SaveFileDialog.Multiselect = False
' Restore the original directory when done selecting
' a file? If False, the current directory changes
' to the directory in which you selected the file.
' Set this to True to put the current folder back
' where it was when you started.
' The default is False.
'.RestoreDirectory = False
' Show the Help button and Read-Only checkbox?
SaveFileDialog.ShowHelp = False
'SaveFileDialog.ShowReadOnly = False
' Start out with the read-only check box checked?
' This only make sense if ShowReadOnly is True.
'SaveFileDialog.ReadOnlyChecked = False
SaveFileDialog.Title = "Save as"
' Only accept valid Win32 file names?
SaveFileDialog.ValidateNames = True
If SaveFileDialog.ShowDialog = Windows.Forms.DialogResult.OK Then
ExportTutorMoves(SaveFileDialog.FileName)
End If
End Sub
End Class

View File

@ -40,30 +40,39 @@ Public Class PokedexListEditor
LoopVar = 0
While LoopVar < (GetString(GetINIFileLocation(), header, "NumberOfPokemon", "")) - 1 = True
Dim PokedexNumToSpecies As List(Of Integer) = AllPokedexNumbertoSpecies()
For Looper As Integer = 0 To PokedexNumToSpecies.Count() - 1
ListBox1.Items.Add(GetPokemonName(PokedexNumToSpecies(Looper)))
Next
If header2 <> "BPE" Then
While LoopVar < (GetString(GetINIFileLocation(), header, "NumberOfPokemon", "")) - 1 = True
ListBox1.Items.Add(GetPokemonName(PokedexNumbertoSpecies(Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexAlphabetTable", "")), System.Globalization.NumberStyles.HexNumber) + (LoopVar * 2), 2))), System.Globalization.NumberStyles.HexNumber))))
If header2 <> "BPE" Then
ListBox4.Items.Add(GetPokemonName((Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexTypeTable", "")), System.Globalization.NumberStyles.HexNumber) + (LoopVar * 2), 2))), System.Globalization.NumberStyles.HexNumber))))
End If
LoopVar = LoopVar + 1
End While
LoopVar = LoopVar + 1
End While
End If
LoopVar = 0
While LoopVar < (GetString(GetINIFileLocation(), header, "NumberOfDexEntries", "")) - 1
Dim PokedexNumToSpeciesLight As List(Of Integer) = AllPokedexNumbertoSpecies("PokedexLightestTable", "NumberOfDexEntries")
ListBox2.Items.Add(GetPokemonName(PokedexNumbertoSpecies(Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexLightestTable", "")), System.Globalization.NumberStyles.HexNumber) + (LoopVar * 2), 2))), System.Globalization.NumberStyles.HexNumber))))
ListBox3.Items.Add(GetPokemonName(PokedexNumbertoSpecies(Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "PokedexSmallestTable", "")), System.Globalization.NumberStyles.HexNumber) + (LoopVar * 2), 2))), System.Globalization.NumberStyles.HexNumber))))
For Looper As Integer = 0 To PokedexNumToSpeciesLight.Count() - 1
ListBox2.Items.Add(GetPokemonName(PokedexNumToSpeciesLight(Looper)))
Next
Dim PokedexNumToSpeciesSmall As List(Of Integer) = AllPokedexNumbertoSpecies("PokedexSmallestTable", "NumberOfDexEntries")
LoopVar = LoopVar + 1
End While
For Looper As Integer = 0 To PokedexNumToSpeciesSmall.Count() - 1
ListBox3.Items.Add(GetPokemonName(PokedexNumToSpeciesSmall(Looper)))
Next
ListBox1.SelectedIndex = 0
ListBox2.SelectedIndex = 0

File diff suppressed because one or more lines are too long

View File

@ -117,6 +117,9 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="HoverInfo.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>603, 17</value>
</metadata>
<metadata name="fileOpenDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>132, 17</value>
</metadata>
@ -126,6 +129,74 @@
<metadata name="FolderBrowserDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>405, 17</value>
</metadata>
<data name="Button14.ToolTip" xml:space="preserve">
<value>Import All Pokemon:
Select a folder containing Pokemon ini files
to import. Files in the folder will be selected for
a Pokemon based on their filename.
Ex: '1.ini' or '1 ~other text~.ini' will be imported
to Pokemon 1.</value>
</data>
<data name="Button28.ToolTip" xml:space="preserve">
<value>Import All Icons:
Choose a folder and import
an icon for each Pokemon.
The filename of each image must
start with the index number of the
Pokemon it will be imported to.
The image will be imported at the
offset of the old icon.
</value>
</data>
<data name="Button39.ToolTip" xml:space="preserve">
<value>Import All Cries:
Choose a folder and import
cries for all Pokemon from .wav
files.
The filename for each cry must
start with the index number of
the Pokemon it corresponds to.
To compress all cries on import,
check the 'Compressed' box
above the import button in the
'Cry Data' tab.</value>
</data>
<data name="Button41.ToolTip" xml:space="preserve">
<value>Import All Icons and Repoint:
Choose a folder and import
an icon for each Pokemon.
The filename of each image must
start with the index number of the
Pokemon it will be imported to.
The image will be imported to
free space and the icon will be
repointed.</value>
</data>
<data name="CheckBox1.ToolTip" xml:space="preserve">
<value>When sprite sheets, sprite palettes,
Pokedex entries, and level up attack lists
are imported, they will be compared to
previous imports from this session. If the
data has already been imported, the data
will be repointed to the previous import,
instead of importing it again.
Imported data is only stored for the time that
this window stays open. Closing and
reopening this window will clear all
'remembered' data.</value>
</data>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>48</value>
</metadata>

File diff suppressed because it is too large Load Diff

View File

@ -28,31 +28,40 @@ Partial Class TMHMEditor
Me.Label2 = New System.Windows.Forms.Label()
Me.AttackList = New System.Windows.Forms.ComboBox()
Me.SvBttn = New System.Windows.Forms.Button()
Me.CheckBox1 = New System.Windows.Forms.CheckBox()
Me.Button2 = New System.Windows.Forms.Button()
Me.Button1 = New System.Windows.Forms.Button()
Me.SaveFileDialog = New System.Windows.Forms.SaveFileDialog()
Me.OpenFileDialog = New System.Windows.Forms.OpenFileDialog()
Me.SuspendLayout()
'
'TMHMList
'
Me.TMHMList.FormattingEnabled = True
Me.TMHMList.Location = New System.Drawing.Point(15, 38)
Me.TMHMList.ItemHeight = 20
Me.TMHMList.Location = New System.Drawing.Point(22, 58)
Me.TMHMList.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.TMHMList.Name = "TMHMList"
Me.TMHMList.Size = New System.Drawing.Size(237, 173)
Me.TMHMList.Size = New System.Drawing.Size(354, 264)
Me.TMHMList.TabIndex = 0
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(12, 22)
Me.Label1.Location = New System.Drawing.Point(18, 34)
Me.Label1.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(67, 13)
Me.Label1.Size = New System.Drawing.Size(93, 20)
Me.Label1.TabIndex = 1
Me.Label1.Text = "TM/HM List:"
'
'Label2
'
Me.Label2.AutoSize = True
Me.Label2.Location = New System.Drawing.Point(12, 224)
Me.Label2.Location = New System.Drawing.Point(18, 345)
Me.Label2.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(41, 13)
Me.Label2.Size = New System.Drawing.Size(59, 20)
Me.Label2.TabIndex = 2
Me.Label2.Text = "Attack:"
'
@ -60,25 +69,64 @@ Partial Class TMHMEditor
'
Me.AttackList.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems
Me.AttackList.FormattingEnabled = True
Me.AttackList.Location = New System.Drawing.Point(59, 221)
Me.AttackList.Location = New System.Drawing.Point(88, 340)
Me.AttackList.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.AttackList.Name = "AttackList"
Me.AttackList.Size = New System.Drawing.Size(121, 21)
Me.AttackList.Size = New System.Drawing.Size(180, 28)
Me.AttackList.TabIndex = 3
'
'SvBttn
'
Me.SvBttn.Location = New System.Drawing.Point(191, 219)
Me.SvBttn.Location = New System.Drawing.Point(286, 337)
Me.SvBttn.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.SvBttn.Name = "SvBttn"
Me.SvBttn.Size = New System.Drawing.Size(61, 23)
Me.SvBttn.Size = New System.Drawing.Size(92, 35)
Me.SvBttn.TabIndex = 4
Me.SvBttn.Text = "Save"
Me.SvBttn.UseVisualStyleBackColor = True
'
'CheckBox1
'
Me.CheckBox1.AutoSize = True
Me.CheckBox1.Location = New System.Drawing.Point(296, 19)
Me.CheckBox1.Name = "CheckBox1"
Me.CheckBox1.Size = New System.Drawing.Size(103, 24)
Me.CheckBox1.TabIndex = 11
Me.CheckBox1.Text = "Skip HMs"
Me.CheckBox1.UseVisualStyleBackColor = True
'
'Button2
'
Me.Button2.Location = New System.Drawing.Point(206, 13)
Me.Button2.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(83, 35)
Me.Button2.TabIndex = 10
Me.Button2.Text = "Import"
Me.Button2.UseVisualStyleBackColor = True
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(119, 13)
Me.Button1.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(79, 35)
Me.Button1.TabIndex = 9
Me.Button1.Text = "Export"
Me.Button1.UseVisualStyleBackColor = True
'
'OpenFileDialog
'
Me.OpenFileDialog.FileName = "OpenFileDialog1"
'
'TMHMEditor
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleDimensions = New System.Drawing.SizeF(9.0!, 20.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(274, 262)
Me.ClientSize = New System.Drawing.Size(411, 403)
Me.Controls.Add(Me.CheckBox1)
Me.Controls.Add(Me.Button2)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.SvBttn)
Me.Controls.Add(Me.AttackList)
Me.Controls.Add(Me.Label2)
@ -86,6 +134,7 @@ Partial Class TMHMEditor
Me.Controls.Add(Me.TMHMList)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.MaximizeBox = False
Me.Name = "TMHMEditor"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
@ -100,4 +149,9 @@ Partial Class TMHMEditor
Friend WithEvents Label2 As Label
Friend WithEvents AttackList As ComboBox
Friend WithEvents SvBttn As Button
Friend WithEvents CheckBox1 As CheckBox
Friend WithEvents Button2 As Button
Friend WithEvents Button1 As Button
Friend WithEvents SaveFileDialog As SaveFileDialog
Friend WithEvents OpenFileDialog As OpenFileDialog
End Class

View File

@ -117,6 +117,12 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="SaveFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="OpenFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>197, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>

View File

@ -6,53 +6,10 @@ Imports System.Net
Imports VB = Microsoft.VisualBasic
Public Class TMHMEditor
Dim TMHMAttacks As Integer
Dim TMHMString As String
Private Sub TMHMEditor_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim LoopVar As Integer
TMHMAttacks = Int32.Parse((GetString(GetINIFileLocation(), header, "TMData", "")), System.Globalization.NumberStyles.HexNumber)
TMHMList.Items.Clear()
LoopVar = 0
While LoopVar < (Val(GetString(GetINIFileLocation(), header, "TotalTMsPlusHMs", ""))) = True
If LoopVar > ((Val(GetString(GetINIFileLocation(), header, "TotalTMs", ""))) - 1) Then
TMHMList.Items.Add("HM" & LoopVar - ((Val(GetString(GetINIFileLocation(), header, "TotalTMs", ""))) - 1) & " - " & GetAttackName(Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, TMHMAttacks + ((LoopVar) * 2), 2))), System.Globalization.NumberStyles.HexNumber)))
LoopVar = LoopVar + 1
ElseIf LoopVar < 9 Then
TMHMList.Items.Add("TM" & "0" & LoopVar + 1 & " - " & GetAttackName(Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, TMHMAttacks + ((LoopVar) * 2), 2))), System.Globalization.NumberStyles.HexNumber)))
LoopVar = LoopVar + 1
Else
TMHMList.Items.Add("TM" & LoopVar + 1 & " - " & GetAttackName(Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, TMHMAttacks + ((LoopVar) * 2), 2))), System.Globalization.NumberStyles.HexNumber)))
LoopVar = LoopVar + 1
End If
End While
AttackList.Items.Clear()
LoopVar = 0
While LoopVar < (GetString(GetINIFileLocation(), header, "NumberOfAttacks", "")) + 1 = True
AttackList.Items.Add(GetAttackName(LoopVar))
LoopVar = LoopVar + 1
End While
TMHMList.SelectedIndex = 0
FillTMHMData()
End Sub
@ -96,4 +53,164 @@ Public Class TMHMEditor
TMHMList.SelectedIndex = indexbuf
End Sub
Private Sub Export_Click(sender As Object, e As EventArgs) Handles Button1.Click
SaveFileDialog.FileName = ("TMHMs") & ".ini"
'SaveFileDialog.CheckFileExists = True
' Check to ensure that the selected path exists. Dialog box displays
' a warning otherwise.
SaveFileDialog.CheckPathExists = True
' Get or set default extension. Doesn't include the leading ".".
SaveFileDialog.DefaultExt = "ini"
' Return the file referenced by a link? If False, simply returns the selected link
' file. If True, returns the file linked to the LNK file.
SaveFileDialog.DereferenceLinks = True
' Just as in VB6, use a set of pairs of filters, separated with "|". Each
' pair consists of a description|file spec. Use a "|" between pairs. No need to put a
' trailing "|". You can set the FilterIndex property as well, to select the default
' filter. The first filter is numbered 1 (not 0). The default is 1.
SaveFileDialog.Filter =
"(*.ini)|*.ini*"
'SaveFileDialog.Multiselect = False
' Restore the original directory when done selecting
' a file? If False, the current directory changes
' to the directory in which you selected the file.
' Set this to True to put the current folder back
' where it was when you started.
' The default is False.
'.RestoreDirectory = False
' Show the Help button and Read-Only checkbox?
SaveFileDialog.ShowHelp = False
'SaveFileDialog.ShowReadOnly = False
' Start out with the read-only check box checked?
' This only make sense if ShowReadOnly is True.
'SaveFileDialog.ReadOnlyChecked = False
SaveFileDialog.Title = "Save as"
' Only accept valid Win32 file names?
SaveFileDialog.ValidateNames = True
If SaveFileDialog.ShowDialog = Windows.Forms.DialogResult.OK Then
ExportTMHMINI(SaveFileDialog.FileName, TMHMString)
End If
End Sub
Private Sub Import_Click(sender As Object, e As EventArgs) Handles Button2.Click
OpenFileDialog.FileName = ""
OpenFileDialog.CheckFileExists = True
' Check to ensure that the selected path exists. Dialog box displays
' a warning otherwise.
OpenFileDialog.CheckPathExists = True
' Get or set default extension. Doesn't include the leading ".".
OpenFileDialog.DefaultExt = "ini"
' Return the file referenced by a link? If False, simply returns the selected link
' file. If True, returns the file linked to the LNK file.
OpenFileDialog.DereferenceLinks = True
' Just as in VB6, use a set of pairs of filters, separated with "|". Each
' pair consists of a description|file spec. Use a "|" between pairs. No need to put a
' trailing "|". You can set the FilterIndex property as well, to select the default
' filter. The first filter is numbered 1 (not 0). The default is 1.
OpenFileDialog.Filter =
"(*.ini)|*.ini*"
OpenFileDialog.Multiselect = False
' Restore the original directory when done selecting
' a file? If False, the current directory changes
' to the directory in which you selected the file.
' Set this to True to put the current folder back
' where it was when you started.
' The default is False.
'.RestoreDirectory = False
' Show the Help button and Read-Only checkbox?
OpenFileDialog.ShowHelp = False
OpenFileDialog.ShowReadOnly = False
' Start out with the read-only check box checked?
' This only make sense if ShowReadOnly is True.
OpenFileDialog.ReadOnlyChecked = False
OpenFileDialog.Title = "Select ini file to import"
' Only accept valid Win32 file names?
OpenFileDialog.ValidateNames = True
If OpenFileDialog.ShowDialog = Windows.Forms.DialogResult.OK Then
ImportTMHMINI(OpenFileDialog.FileName)
FillTMHMData()
End If
End Sub
Private Sub FillTMHMData()
TMHMString = ""
Dim LoopVar As Integer
TMHMAttacks = Int32.Parse((GetString(GetINIFileLocation(), header, "TMData", "")), System.Globalization.NumberStyles.HexNumber)
TMHMList.Items.Clear()
LoopVar = 0
While LoopVar < (Val(GetString(GetINIFileLocation(), header, "TotalTMsPlusHMs", ""))) = True
If LoopVar > ((Val(GetString(GetINIFileLocation(), header, "TotalTMs", ""))) - 1) Then
TMHMList.Items.Add("HM" & LoopVar - ((Val(GetString(GetINIFileLocation(), header, "TotalTMs", ""))) - 1) & " - " & GetAttackName(Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, TMHMAttacks + ((LoopVar) * 2), 2))), System.Globalization.NumberStyles.HexNumber)))
ElseIf LoopVar < 9 Then
TMHMList.Items.Add("TM" & "0" & LoopVar + 1 & " - " & GetAttackName(Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, TMHMAttacks + ((LoopVar) * 2), 2))), System.Globalization.NumberStyles.HexNumber)))
Else
TMHMList.Items.Add("TM" & LoopVar + 1 & " - " & GetAttackName(Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, TMHMAttacks + ((LoopVar) * 2), 2))), System.Globalization.NumberStyles.HexNumber)))
End If
TMHMString = TMHMString & ReadHEX(LoadedROM, TMHMAttacks + ((LoopVar) * 2), 2)
LoopVar = LoopVar + 1
End While
AttackList.Items.Clear()
LoopVar = 0
While LoopVar < (GetString(GetINIFileLocation(), header, "NumberOfAttacks", "")) + 1 = True
AttackList.Items.Add(GetAttackName(LoopVar))
LoopVar = LoopVar + 1
End While
TMHMList.SelectedIndex = 0
End Sub
End Class

View File

@ -178,6 +178,35 @@ Module WichuSpriteFunctions
Return source
End Function
Public Function GetBitmapPaletteNoLimit(ByRef sprite As Bitmap) As Color()
Dim source As List(Of Color) = New List(Of Color)
Dim output As Color()
Dim index As Byte = 0
Dim num4 As Integer = (sprite.Width - 1)
Dim i As Integer = 0
Do While (i <= num4)
Dim num5 As Integer = (sprite.Height - 1)
Dim j As Integer = 0
Do While (j <= num5)
Dim pixel As Color = sprite.GetPixel(i, j)
If Not Enumerable.Contains(Of Color)(source, pixel) Then
source.Add(pixel)
Try
index = CByte((index + 1))
Catch
output = source.ToArray()
Return output
End Try
End If
j += 1
Loop
i += 1
Loop
output = source.ToArray()
Return output
End Function
Public Function GetBottom(ByRef bitmap As Bitmap) As Integer
Dim num As Integer
Dim height As Integer = bitmap.Height
@ -224,6 +253,19 @@ Module WichuSpriteFunctions
Dim num As Integer = -1
Dim num7 As Integer = (palettes.Length - 1)
Dim i As Integer = 0
Dim blankColor As Color = Color.FromArgb(&H0)
Dim tempPal As List(Of Color) = New List(Of Color)
For Each color In bitmapPalette
If Not color.ToArgb() = blankColor.ToArgb() Then
tempPal.Add(color)
End If
Next
ReDim bitmapPalette(tempPal.Count)
bitmapPalette = tempPal.ToArray()
Do While (i <= num7)
Dim num4 As Integer = 0
Dim num8 As Integer = (bitmapPalette.Length - 1)

View File

@ -1,3 +1,3 @@
[Settings]
OSisLinux=0
DisableCryImage=1
DisableCryImage=0

View File

@ -1,23 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xrml="urn:mpeg:mpeg21:2003:01-REL-R-NS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1" xmlns:co.v2="urn:schemas-microsoft-com:clickonce.v2">
<assemblyIdentity name="GBAPokemonGameEditor.application" version="3.3.0.0" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" xmlns="urn:schemas-microsoft-com:asm.v1" />
<description asmv2:publisher="GBAPokemonGameEditor" asmv2:product="GBAPokemonGameEditor" xmlns="urn:schemas-microsoft-com:asm.v1" />
<deployment install="true" mapFileExtensions="true">
<deploymentProvider codebase="http://gamer2020.0xrh.net/programs/GBAPokemonGameEditor/GBAPokemonGameEditor.application" />
</deployment>
<compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
<framework targetVersion="4.0" profile="Full" supportedRuntime="4.0.30319" />
</compatibleFrameworks>
<dependency>
<dependentAssembly dependencyType="install" codebase="GBAPokemonGameEditor.exe.manifest" size="4678">
<assemblyIdentity name="GBAPokemonGameEditor.exe" version="3.3.0.0" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" type="win32" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<dsig:DigestValue>FREzo5Pr89tXmUxB9nB+ZUlCAIg=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
</asmv1:assembly>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>

View File

@ -1,82 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:co.v2="urn:schemas-microsoft-com:clickonce.v2">
<asmv1:assemblyIdentity name="GBAPokemonGameEditor.exe" version="3.3.0.0" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" type="win32" />
<description asmv2:iconFile="icon.ico" xmlns="urn:schemas-microsoft-com:asm.v1" />
<application />
<entryPoint>
<assemblyIdentity name="GBAPokemonGameEditor" version="3.3.0.0" language="neutral" processorArchitecture="msil" />
<commandLine file="GBAPokemonGameEditor.exe" parameters="" />
</entryPoint>
<trustInfo>
<security>
<applicationRequestMinimum>
<PermissionSet version="1" class="System.Security.NamedPermissionSet" Name="LocalIntranet" Description="Default rights given to applications on the local intranet" Unrestricted="true" ID="Custom" SameSite="site" />
<defaultAssemblyRequest permissionSetReference="Custom" />
</applicationRequestMinimum>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC Manifest Options
If you want to change the Windows User Account Control level replace the
requestedExecutionLevel node with one of the following.
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
Specifying requestedExecutionLevel node will disable file and registry virtualization.
If you want to utilize File and Registry Virtualization for backward
compatibility then delete the requestedExecutionLevel node.
-->
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<dependency>
<dependentOS>
<osVersionInfo>
<os majorVersion="5" minorVersion="1" buildNumber="2600" servicePackMajor="0" />
</osVersionInfo>
</dependentOS>
</dependency>
<dependency>
<dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
<assemblyIdentity name="Microsoft.Windows.CommonLanguageRuntime" version="4.0.30319.0" />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="GBAPokemonGameEditor.exe" size="1469440">
<assemblyIdentity name="GBAPokemonGameEditor" version="3.3.0.0" language="neutral" processorArchitecture="msil" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<dsig:DigestValue>ijo0oxf8y8stOnffLBWwYQHF5YQ=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
<file name="GBAPokemonGameEditor.exe.config" size="183">
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<dsig:DigestValue>zmtMKrAEuvsQh2jJFtlCNruBIWE=</dsig:DigestValue>
</hash>
</file>
<file name="icon.ico" size="38078">
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<dsig:DigestValue>zSGVcEGIWr3V6kRbwOGSlYIDyTs=</dsig:DigestValue>
</hash>
</file>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of all Windows versions that this application is designed to work with. Windows will automatically select the most compatible environment.-->
<!-- If your application is designed to work with Windows 7, uncomment the following supportedOS node-->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>-->
</application>
</compatibility>
</asmv1:assembly>

View File

@ -9,14 +9,14 @@
<framework targetVersion="4.5" profile="Full" supportedRuntime="4.0.30319" />
</compatibleFrameworks>
<dependency>
<dependentAssembly dependencyType="install" codebase="PokemonGameEditor.exe.manifest" size="4714">
<dependentAssembly dependencyType="install" codebase="PokemonGameEditor.exe.manifest" size="7578">
<assemblyIdentity name="PokemonGameEditor.exe" version="3.8.1.0" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" type="win32" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>ZPldB61y37uHoxUw3d9sjfXQNo6uXLUSu3S+Zm/hJaA=</dsig:DigestValue>
<dsig:DigestValue>+ozcpp+1WQkmLxHf9Bs7nRlyNAeOoeSwufL8iHFYYH8=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>

View File

@ -10,10 +10,34 @@
<trustInfo>
<security>
<applicationRequestMinimum>
<PermissionSet version="1" class="System.Security.NamedPermissionSet" Name="LocalIntranet" Description="Default rights given to applications on the local intranet" Unrestricted="true" ID="Custom" SameSite="site" />
<PermissionSet version="1" class="System.Security.NamedPermissionSet" Name="LocalIntranet" Description="Default rights given to applications on the local intranet" ID="Custom" SameSite="site">
<IPermission Read="USERNAME" version="1" class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<IPermission version="1" class="System.Security.Permissions.FileDialogPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Unrestricted="true" />
<IPermission version="1" Permanent="True" Expiry="9223372036854775807" UserQuota="9223372036854775807" Allowed="AssemblyIsolationByUser" class="System.Security.Permissions.IsolatedStorageFilePermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<IPermission version="1" class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Flags="ReflectionEmit, RestrictedMemberAccess" />
<IPermission version="1" class="System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Flags="Assertion, Execution, BindingRedirects" />
<IPermission version="1" class="System.Security.Permissions.UIPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Unrestricted="true" />
<IPermission version="1" class="System.Drawing.Printing.PrintingPermission, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Level="DefaultPrinting" />
<IPermission version="1" class="System.Security.Permissions.MediaPermission, WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Audio="SafeAudio" Image="SafeImage" Video="SafeVideo" />
<IPermission version="1" class="System.Security.Permissions.WebBrowserPermission, WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Level="Safe" />
<IPermission version="1" class="System.Net.DnsPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Unrestricted="true" />
<IPermission version="1" class="System.Security.Permissions.TypeDescriptorPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Unrestricted="true" />
</PermissionSet>
<defaultAssemblyRequest permissionSetReference="Custom" />
</applicationRequestMinimum>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!--
UAC Manifest Options
If you want to change the Windows User Account Control level replace the
requestedExecutionLevel node with one of the following.
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
If you want to utilize File and Registry Virtualization for backward
compatibility then delete the requestedExecutionLevel node.
-->
<!-- UAC Manifest Options
If you want to change the Windows User Account Control level replace the
requestedExecutionLevel node with one of the following.
@ -43,14 +67,14 @@
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="PokemonGameEditor.exe" size="2085888">
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="PokemonGameEditor.exe" size="2123264">
<assemblyIdentity name="PokemonGameEditor" version="3.8.1.0" language="neutral" processorArchitecture="msil" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>OcpzcyjEychSbS73gzzApWC7NRIXJInBLOU5Ortf8So=</dsig:DigestValue>
<dsig:DigestValue>inuC4NBp+vXFya69SCgil1RImxuHpi8Z2YvG/a6yyD4=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
</configuration>

View File

@ -209,15 +209,16 @@ Module mMain
Dim bytesloaded As Byte()
bytesloaded = IO.File.ReadAllBytes(LoadedROM)
Dim NationalDexTable As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "NationalDexTable", ""), System.Globalization.NumberStyles.HexNumber)
' If DexNumber = Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "NationalDexTable", "")), System.Globalization.NumberStyles.HexNumber) + ((DexNumber - 1) * 2), 2))), System.Globalization.NumberStyles.HexNumber) Then
If DexNumber = Int32.Parse((ReverseHEX(Get2Bytes(bytesloaded, Int32.Parse((GetString(GetINIFileLocation(), header, "NationalDexTable", "")), System.Globalization.NumberStyles.HexNumber) + ((DexNumber - 1) * 2)))), System.Globalization.NumberStyles.HexNumber) Then
If DexNumber = Int32.Parse((ReverseHEX(Get2Bytes(bytesloaded, NationalDexTable + ((DexNumber - 1) * 2)))), System.Globalization.NumberStyles.HexNumber) Then
curval = DexNumber - 1
Else
' While DexNumber <> Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "NationalDexTable", "")), System.Globalization.NumberStyles.HexNumber) + (curval * 2), 2))), System.Globalization.NumberStyles.HexNumber)
While DexNumber <> Int32.Parse((ReverseHEX(Get2Bytes(bytesloaded, Int32.Parse((GetString(GetINIFileLocation(), header, "NationalDexTable", "")), System.Globalization.NumberStyles.HexNumber) + (curval * 2)))), System.Globalization.NumberStyles.HexNumber)
While DexNumber <> Int32.Parse((ReverseHEX(Get2Bytes(bytesloaded, NationalDexTable + (curval * 2)))), System.Globalization.NumberStyles.HexNumber)
curval = curval + 1
End While
@ -225,6 +226,42 @@ Module mMain
PokedexNumbertoSpecies = curval + 1
End Function
Public Function AllPokedexNumbertoSpecies(Optional DexTableName As String = "PokedexAlphabetTable", Optional PkmnCountName As String = "NumberOfPokemon") As List(Of Integer)
Dim curval As Integer = 0
Dim MaxPkmn As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, PkmnCountName, "")) - 1
Dim Dexnumbers As String = ReadHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, DexTableName, "")), System.Globalization.NumberStyles.HexNumber), MaxPkmn * 2)
Dim bytesloaded As Byte()
Dim PkmnList As List(Of Integer) = New List(Of Integer)
Dim DexNumber As Integer = 0
Dim NationalDexTable As Integer = Int32.Parse(GetString(GetINIFileLocation(), header, "NationalDexTable", ""), System.Globalization.NumberStyles.HexNumber)
bytesloaded = IO.File.ReadAllBytes(LoadedROM)
For LoopVar As Integer = 0 To MaxPkmn - 1
DexNumber = Int32.Parse(ReverseHEX(Dexnumbers.Substring(LoopVar * 4, 4)), System.Globalization.NumberStyles.HexNumber)
' If DexNumber = Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "NationalDexTable", "")), System.Globalization.NumberStyles.HexNumber) + ((DexNumber - 1) * 2), 2))), System.Globalization.NumberStyles.HexNumber) Then
If DexNumber = Int32.Parse((ReverseHEX(Get2Bytes(bytesloaded, NationalDexTable + ((DexNumber - 1) * 2)))), System.Globalization.NumberStyles.HexNumber) Then
curval = DexNumber - 1
Else
' While DexNumber <> Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, Int32.Parse((GetString(GetINIFileLocation(), header, "NationalDexTable", "")), System.Globalization.NumberStyles.HexNumber) + (curval * 2), 2))), System.Globalization.NumberStyles.HexNumber)
While DexNumber <> Int32.Parse((ReverseHEX(Get2Bytes(bytesloaded, NationalDexTable + (curval * 2)))), System.Globalization.NumberStyles.HexNumber)
curval = curval + 1
End While
End If
PkmnList.Add(curval + 1)
curval = 0
Next
AllPokedexNumbertoSpecies = PkmnList
End Function
Public Function Get2Bytes(bytesin As Byte(), local As Integer) As String
Get2Bytes = MakeProperByte(bytesin(local)) & MakeProperByte(bytesin(local + 1))

View File

@ -149,7 +149,7 @@ Module modSearchFreeSpace
' MsgBox(CInt("&H" & CurSearchOffset) + CInt(SearchIncrement))
CurSearchOffset = Hex(FindFreeSpace(FileName, FreeSpaceByte, NeededBytes, CInt("&H" & CurSearchOffset) + CInt(SearchIncrement)))
CurSearchOffset = Hex(FindFreeSpace(FileName, FreeSpaceByte, NeededBytes, CInt("&H" & CurSearchOffset) + CInt(SearchIncrement), True))
SearchIncrement = SearchIncrement + 1
@ -159,7 +159,7 @@ Module modSearchFreeSpace
End Function
Private Function FindFreeSpace(selectedROMPath As String, freeSpaceByte As Byte, dataSize As Integer, startLocation As Integer) As Integer
Private Function FindFreeSpace(selectedROMPath As String, freeSpaceByte As Byte, dataSize As Integer, startLocation As Integer, Optional alignFour As Boolean = False) As Integer
Dim rom As Byte() = File.ReadAllBytes(selectedROMPath)
@ -168,6 +168,7 @@ Module modSearchFreeSpace
For i As Integer = 0 To dataSize
If startLocation + dataSize <= rom.Length Then
If rom(startLocation + i) <> freeSpaceByte Then
startLocation += i + 1
Exit For
ElseIf i = dataSize Then
spaceFound = True
@ -181,7 +182,9 @@ Module modSearchFreeSpace
End If
Next
If Not spaceFound Then
startLocation += 1
If alignFour Then
startLocation += 4 - (startLocation Mod 4)
End If
End If
End While
Return startLocation

View File

@ -1,98 +0,0 @@
Option Strict Off
Option Explicit Off
Imports VB = Microsoft.VisualBasic
Public Class movetutor2
Dim Offset As Integer
'Dim Offset2 As Long
Private Sub movetutor2_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.Cursor = Cursors.WaitCursor
If header2 = "BPR" Or header2 = "BPG" Or header2 = "BPE" Then
Offset = Int32.Parse((GetString(GetINIFileLocation(), header, "MoveTutorAttacks", "")), System.Globalization.NumberStyles.HexNumber)
Dim loopything As String = 0
Dim curattack As String
Combo1.Items.Clear() 'Clears the combo boxes
While loopything < (Val(GetString(GetINIFileLocation(), header, "NumberOfAttacks", "")) + 1)
curattack = GetAttackName(loopything)
Combo1.Items.Add(curattack) 'adds the attacks to the comboboxes
loopything = loopything + 1
End While
loopything = 0
ListBox1.Items.Clear()
While loopything < (Val(GetString(GetINIFileLocation(), header, "NumberOfMoveTutorAttacks", "")))
ListBox1.Items.Add(GetAttackName(Int32.Parse(((ReverseHEX(ReadHEX(LoadedROM, Offset + (2 * loopything), 2)))), System.Globalization.NumberStyles.HexNumber)))
loopything = loopything + 1
End While
Me.Cursor = Cursors.Arrow
ListBox1.SelectedIndex = 0
Else
'If the ROM is not supported this code will run
Combo1.Enabled = False
Button2.Enabled = False
Combo1.Items.Clear() 'Clears the combo boxes
MsgBox("Unsupported ROM!")
'Lets the person know the ROM isn't supported.
End
End If
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim indexbuff As Integer
indexbuff = ListBox1.SelectedIndex
WriteHEX(LoadedROM, Offset + (2 * ListBox1.SelectedIndex), ReverseHEX(VB.Right("0000" & Hex(Combo1.SelectedIndex), 4)))
Dim loopything As String = 0
ListBox1.Items.Clear()
While loopything < (Val(GetString(GetINIFileLocation(), header, "NumberOfMoveTutorAttacks", "")))
ListBox1.Items.Add(GetAttackName(Int32.Parse(((ReverseHEX(ReadHEX(LoadedROM, Offset + (2 * loopything), 2)))), System.Globalization.NumberStyles.HexNumber)))
loopything = loopything + 1
End While
Me.Cursor = Cursors.Arrow
ListBox1.SelectedIndex = indexbuff
End Sub
Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox1.SelectedIndexChanged
Combo1.SelectedIndex = ((Int32.Parse(((ReverseHEX(ReadHEX(LoadedROM, Offset + (2 * ListBox1.SelectedIndex), 2)))), System.Globalization.NumberStyles.HexNumber)))
End Sub
End Class

View File

@ -0,0 +1 @@
302e1968ba2c5026d2d388fde540996acfec2ab2

View File

@ -224,3 +224,77 @@ D:\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\GBAPokemonGameEdi
C:\Users\Gamer2020\Documents\GitHub\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.TrainerEditor.resources
C:\Users\Gamer2020\Documents\GitHub\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\GBAPokemonGameEditor.vbprojAssemblyReference.cache
C:\Users\Gamer2020\Documents\GitHub\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\GBAPokemonGameEditor.vbproj.CoreCompileInputs.cache
C:\Users\manma\Desktop\Shortcuts\Github\PokemonGameEditor\GBAPokemonGameEditor\bin\Debug\PokemonGameEditor.exe.config
C:\Users\manma\Desktop\Shortcuts\Github\PokemonGameEditor\GBAPokemonGameEditor\bin\Debug\PokemonGameEditor.exe.manifest
C:\Users\manma\Desktop\Shortcuts\Github\PokemonGameEditor\GBAPokemonGameEditor\bin\Debug\PokemonGameEditor.application
C:\Users\manma\Desktop\Shortcuts\Github\PokemonGameEditor\GBAPokemonGameEditor\bin\Debug\PokemonGameEditor.exe
C:\Users\manma\Desktop\Shortcuts\Github\PokemonGameEditor\GBAPokemonGameEditor\bin\Debug\PokemonGameEditor.pdb
C:\Users\manma\Desktop\Shortcuts\Github\PokemonGameEditor\GBAPokemonGameEditor\bin\Debug\PokemonGameEditor.xml
C:\Users\manma\Desktop\Shortcuts\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\GBAPokemonGameEditor.vbprojAssemblyReference.cache
C:\Users\manma\Desktop\Shortcuts\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.AbilityAdder.resources
C:\Users\manma\Desktop\Shortcuts\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.AbilityEdit.resources
C:\Users\manma\Desktop\Shortcuts\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.AboutBox1.resources
C:\Users\manma\Desktop\Shortcuts\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.AddOrRemovePrograms.resources
C:\Users\manma\Desktop\Shortcuts\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.AttackEditor.resources
C:\Users\manma\Desktop\Shortcuts\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.AttackAdder.resources
C:\Users\manma\Desktop\Shortcuts\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.BattleFrontierEditor.resources
C:\Users\manma\Desktop\Shortcuts\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.EggMoveEditor.resources
C:\Users\manma\Desktop\Shortcuts\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.HabitatEditor.resources
C:\Users\manma\Desktop\Shortcuts\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.InputAttacks.resources
C:\Users\manma\Desktop\Shortcuts\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.ItemEditor.resources
C:\Users\manma\Desktop\Shortcuts\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.MainFrm.resources
C:\Users\manma\Desktop\Shortcuts\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.movetutor2.resources
C:\Users\manma\Desktop\Shortcuts\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.Resources.resources
C:\Users\manma\Desktop\Shortcuts\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.PokedexDataEditor.resources
C:\Users\manma\Desktop\Shortcuts\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.PokedexListEditor.resources
C:\Users\manma\Desktop\Shortcuts\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.PokedexOrderEditor.resources
C:\Users\manma\Desktop\Shortcuts\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.PokemonAdder.resources
C:\Users\manma\Desktop\Shortcuts\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.Pokemonedit.resources
C:\Users\manma\Desktop\Shortcuts\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.RomExpander.resources
C:\Users\manma\Desktop\Shortcuts\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.RSEStarterEditor.resources
C:\Users\manma\Desktop\Shortcuts\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.SplashScreen1.resources
C:\Users\manma\Desktop\Shortcuts\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.TMHMEditor.resources
C:\Users\manma\Desktop\Shortcuts\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.TradeEditor.resources
C:\Users\manma\Desktop\Shortcuts\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.TrainerEditor.resources
C:\Users\manma\Desktop\Shortcuts\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\GBAPokemonGameEditor.vbproj.GenerateResource.cache
C:\Users\manma\Desktop\Shortcuts\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\GBAPokemonGameEditor.vbproj.CoreCompileInputs.cache
C:\Users\manma\Desktop\Shortcuts\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.TrustInfo.xml
C:\Users\manma\Desktop\Shortcuts\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.exe.manifest
C:\Users\manma\Desktop\Shortcuts\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.application
C:\Users\manma\Desktop\Shortcuts\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.exe
C:\Users\manma\Desktop\Shortcuts\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.xml
C:\Users\manma\Desktop\Shortcuts\Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.pdb
C:\Users\manma\Documents\PokeDev\PGE-Github\PokemonGameEditor\GBAPokemonGameEditor\bin\Debug\PokemonGameEditor.exe.config
C:\Users\manma\Documents\PokeDev\PGE-Github\PokemonGameEditor\GBAPokemonGameEditor\bin\Debug\PokemonGameEditor.exe
C:\Users\manma\Documents\PokeDev\PGE-Github\PokemonGameEditor\GBAPokemonGameEditor\bin\Debug\PokemonGameEditor.pdb
C:\Users\manma\Documents\PokeDev\PGE-Github\PokemonGameEditor\GBAPokemonGameEditor\bin\Debug\PokemonGameEditor.xml
C:\Users\manma\Documents\PokeDev\PGE-Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.AbilityAdder.resources
C:\Users\manma\Documents\PokeDev\PGE-Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.AbilityEdit.resources
C:\Users\manma\Documents\PokeDev\PGE-Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.AboutBox1.resources
C:\Users\manma\Documents\PokeDev\PGE-Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.AddOrRemovePrograms.resources
C:\Users\manma\Documents\PokeDev\PGE-Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.AttackEditor.resources
C:\Users\manma\Documents\PokeDev\PGE-Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.AttackAdder.resources
C:\Users\manma\Documents\PokeDev\PGE-Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.BattleFrontierEditor.resources
C:\Users\manma\Documents\PokeDev\PGE-Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.EggMoveEditor.resources
C:\Users\manma\Documents\PokeDev\PGE-Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.HabitatEditor.resources
C:\Users\manma\Documents\PokeDev\PGE-Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.InputAttacks.resources
C:\Users\manma\Documents\PokeDev\PGE-Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.ItemEditor.resources
C:\Users\manma\Documents\PokeDev\PGE-Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.MainFrm.resources
C:\Users\manma\Documents\PokeDev\PGE-Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.MoveTutorEditor.resources
C:\Users\manma\Documents\PokeDev\PGE-Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.Resources.resources
C:\Users\manma\Documents\PokeDev\PGE-Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.PokedexDataEditor.resources
C:\Users\manma\Documents\PokeDev\PGE-Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.PokedexListEditor.resources
C:\Users\manma\Documents\PokeDev\PGE-Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.PokedexOrderEditor.resources
C:\Users\manma\Documents\PokeDev\PGE-Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.PokemonAdder.resources
C:\Users\manma\Documents\PokeDev\PGE-Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.Pokemonedit.resources
C:\Users\manma\Documents\PokeDev\PGE-Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.RomExpander.resources
C:\Users\manma\Documents\PokeDev\PGE-Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.RSEStarterEditor.resources
C:\Users\manma\Documents\PokeDev\PGE-Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.SplashScreen1.resources
C:\Users\manma\Documents\PokeDev\PGE-Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.TMHMEditor.resources
C:\Users\manma\Documents\PokeDev\PGE-Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.TradeEditor.resources
C:\Users\manma\Documents\PokeDev\PGE-Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.TrainerEditor.resources
C:\Users\manma\Documents\PokeDev\PGE-Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\GBAPokemonGameEditor.vbproj.GenerateResource.cache
C:\Users\manma\Documents\PokeDev\PGE-Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\GBAPokemonGameEditor.vbproj.CoreCompileInputs.cache
C:\Users\manma\Documents\PokeDev\PGE-Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.exe
C:\Users\manma\Documents\PokeDev\PGE-Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.xml
C:\Users\manma\Documents\PokeDev\PGE-Github\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\PokemonGameEditor.pdb

View File

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="utf-8"?><trustInfo xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2"><security><applicationRequestMinimum><PermissionSet version="1" class="System.Security.NamedPermissionSet" Name="LocalIntranet" Description="Default rights given to applications on the local intranet" Unrestricted="true" ID="Custom" SameSite="site" /><defaultAssemblyRequest permissionSetReference="Custom" /></applicationRequestMinimum><requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3"><!-- UAC Manifest Options
If you want to change the Windows User Account Control level replace the
requestedExecutionLevel node with one of the following.
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
Specifying requestedExecutionLevel node will disable file and registry virtualization.
If you want to utilize File and Registry Virtualization for backward
compatibility then delete the requestedExecutionLevel node.
--><requestedExecutionLevel level="asInvoker" uiAccess="false" /></requestedPrivileges></security></trustInfo>

View File

@ -9,14 +9,14 @@
<framework targetVersion="4.5" profile="Full" supportedRuntime="4.0.30319" />
</compatibleFrameworks>
<dependency>
<dependentAssembly dependencyType="install" codebase="PokemonGameEditor.exe.manifest" size="4714">
<dependentAssembly dependencyType="install" codebase="PokemonGameEditor.exe.manifest" size="7578">
<assemblyIdentity name="PokemonGameEditor.exe" version="3.8.1.0" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" type="win32" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>ZPldB61y37uHoxUw3d9sjfXQNo6uXLUSu3S+Zm/hJaA=</dsig:DigestValue>
<dsig:DigestValue>+ozcpp+1WQkmLxHf9Bs7nRlyNAeOoeSwufL8iHFYYH8=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>

View File

@ -10,10 +10,34 @@
<trustInfo>
<security>
<applicationRequestMinimum>
<PermissionSet version="1" class="System.Security.NamedPermissionSet" Name="LocalIntranet" Description="Default rights given to applications on the local intranet" Unrestricted="true" ID="Custom" SameSite="site" />
<PermissionSet version="1" class="System.Security.NamedPermissionSet" Name="LocalIntranet" Description="Default rights given to applications on the local intranet" ID="Custom" SameSite="site">
<IPermission Read="USERNAME" version="1" class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<IPermission version="1" class="System.Security.Permissions.FileDialogPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Unrestricted="true" />
<IPermission version="1" Permanent="True" Expiry="9223372036854775807" UserQuota="9223372036854775807" Allowed="AssemblyIsolationByUser" class="System.Security.Permissions.IsolatedStorageFilePermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<IPermission version="1" class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Flags="ReflectionEmit, RestrictedMemberAccess" />
<IPermission version="1" class="System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Flags="Assertion, Execution, BindingRedirects" />
<IPermission version="1" class="System.Security.Permissions.UIPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Unrestricted="true" />
<IPermission version="1" class="System.Drawing.Printing.PrintingPermission, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Level="DefaultPrinting" />
<IPermission version="1" class="System.Security.Permissions.MediaPermission, WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Audio="SafeAudio" Image="SafeImage" Video="SafeVideo" />
<IPermission version="1" class="System.Security.Permissions.WebBrowserPermission, WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Level="Safe" />
<IPermission version="1" class="System.Net.DnsPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Unrestricted="true" />
<IPermission version="1" class="System.Security.Permissions.TypeDescriptorPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Unrestricted="true" />
</PermissionSet>
<defaultAssemblyRequest permissionSetReference="Custom" />
</applicationRequestMinimum>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!--
UAC Manifest Options
If you want to change the Windows User Account Control level replace the
requestedExecutionLevel node with one of the following.
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
If you want to utilize File and Registry Virtualization for backward
compatibility then delete the requestedExecutionLevel node.
-->
<!-- UAC Manifest Options
If you want to change the Windows User Account Control level replace the
requestedExecutionLevel node with one of the following.
@ -43,14 +67,14 @@
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="PokemonGameEditor.exe" size="2085888">
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="PokemonGameEditor.exe" size="2123264">
<assemblyIdentity name="PokemonGameEditor" version="3.8.1.0" language="neutral" processorArchitecture="msil" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>OcpzcyjEychSbS73gzzApWC7NRIXJInBLOU5Ortf8So=</dsig:DigestValue>
<dsig:DigestValue>inuC4NBp+vXFya69SCgil1RImxuHpi8Z2YvG/a6yyD4=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>