TM/HM editor added!

I added a TM/HM editor. I just felt like tit would be easier if it was
separate from the item editor. Item editor is coming up next!
This commit is contained in:
Gamer2020 2015-10-25 11:42:16 -04:00
parent af04c874de
commit eeda203fe4
22 changed files with 371 additions and 18 deletions

Binary file not shown.

View File

@ -217,6 +217,12 @@
<Compile Include="RSEStarterEditor.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="TMHMEditor.Designer.vb">
<DependentUpon>TMHMEditor.vb</DependentUpon>
</Compile>
<Compile Include="TMHMEditor.vb">
<SubType>Form</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="AbilityEdit.resx">
@ -262,6 +268,9 @@
<EmbeddedResource Include="RSEStarterEditor.resx">
<DependentUpon>RSEStarterEditor.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="TMHMEditor.resx">
<DependentUpon>TMHMEditor.vb</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />

View File

@ -176,19 +176,19 @@ Partial Class MainFrm
'EditRomsiniToolStripMenuItem
'
Me.EditRomsiniToolStripMenuItem.Name = "EditRomsiniToolStripMenuItem"
Me.EditRomsiniToolStripMenuItem.Size = New System.Drawing.Size(152, 22)
Me.EditRomsiniToolStripMenuItem.Size = New System.Drawing.Size(140, 22)
Me.EditRomsiniToolStripMenuItem.Text = "Edit roms.ini"
'
'ToolStripMenuItem6
'
Me.ToolStripMenuItem6.Name = "ToolStripMenuItem6"
Me.ToolStripMenuItem6.Size = New System.Drawing.Size(149, 6)
Me.ToolStripMenuItem6.Size = New System.Drawing.Size(137, 6)
'
'AboutToolStripMenuItem
'
Me.AboutToolStripMenuItem.Enabled = False
Me.AboutToolStripMenuItem.Name = "AboutToolStripMenuItem"
Me.AboutToolStripMenuItem.Size = New System.Drawing.Size(152, 22)
Me.AboutToolStripMenuItem.Size = New System.Drawing.Size(140, 22)
Me.AboutToolStripMenuItem.Text = "About"
'
'GroupBox4
@ -370,7 +370,7 @@ Partial Class MainFrm
Me.Button35.Name = "Button35"
Me.Button35.Size = New System.Drawing.Size(79, 55)
Me.Button35.TabIndex = 45
Me.Button35.Text = "Button35"
Me.Button35.Text = "TM/HM Editor"
Me.Button35.UseVisualStyleBackColor = True
'
'Button36

View File

@ -321,6 +321,8 @@ Public Class MainFrm
Button26.Enabled = False
Button32.Enabled = False
Button33.Enabled = False
Button34.Enabled = False
Button35.Enabled = False
MessageBox.Show("I haven't added Jap support out of pure lazziness. I will though if it get's highly Demanded.")
Else
@ -334,6 +336,8 @@ Public Class MainFrm
Button24.Enabled = True
Button32.Enabled = True
Button33.Enabled = True
Button34.Enabled = True
Button35.Enabled = True
End If
Else
Label2.Text = ""
@ -346,6 +350,8 @@ Public Class MainFrm
Button24.Enabled = False
Button32.Enabled = False
Button33.Enabled = False
Button34.Enabled = False
Button35.Enabled = False
MessageBox.Show("Not one of the Pokemon games...")
End If
@ -796,5 +802,13 @@ Public Class MainFrm
End If
End Sub
Private Sub Button34_Click(sender As Object, e As EventArgs) Handles Button34.Click
End Sub
Private Sub Button35_Click(sender As Object, e As EventArgs) Handles Button35.Click
Me.Cursor = Cursors.WaitCursor
TMHMEditor.Show()
Me.Cursor = Cursors.Arrow
End Sub
End Class

View File

@ -0,0 +1,101 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class TMHMEditor
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'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()> _
Private Sub InitializeComponent()
Me.TMHMList = New System.Windows.Forms.ListBox()
Me.Label1 = New System.Windows.Forms.Label()
Me.Label2 = New System.Windows.Forms.Label()
Me.AttackList = New System.Windows.Forms.ComboBox()
Me.SvBttn = New System.Windows.Forms.Button()
Me.SuspendLayout()
'
'TMHMList
'
Me.TMHMList.FormattingEnabled = True
Me.TMHMList.Location = New System.Drawing.Point(15, 38)
Me.TMHMList.Name = "TMHMList"
Me.TMHMList.Size = New System.Drawing.Size(237, 173)
Me.TMHMList.TabIndex = 0
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(12, 22)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(67, 13)
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.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(41, 13)
Me.Label2.TabIndex = 2
Me.Label2.Text = "Attack:"
'
'AttackList
'
Me.AttackList.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.AttackList.FormattingEnabled = True
Me.AttackList.Location = New System.Drawing.Point(59, 221)
Me.AttackList.Name = "AttackList"
Me.AttackList.Size = New System.Drawing.Size(121, 21)
Me.AttackList.TabIndex = 3
'
'SvBttn
'
Me.SvBttn.Location = New System.Drawing.Point(191, 219)
Me.SvBttn.Name = "SvBttn"
Me.SvBttn.Size = New System.Drawing.Size(61, 23)
Me.SvBttn.TabIndex = 4
Me.SvBttn.Text = "Save"
Me.SvBttn.UseVisualStyleBackColor = True
'
'TMHMEditor
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(274, 262)
Me.Controls.Add(Me.SvBttn)
Me.Controls.Add(Me.AttackList)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.TMHMList)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
Me.MaximizeBox = False
Me.Name = "TMHMEditor"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "TM/HM Editor"
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents TMHMList As ListBox
Friend WithEvents Label1 As Label
Friend WithEvents Label2 As Label
Friend WithEvents AttackList As ComboBox
Friend WithEvents SvBttn As Button
End Class

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,108 @@
Option Strict Off
Option Explicit On
Imports System.IO.Directory
Imports System.Windows.Forms.Application
Imports System.Net
Imports VB = Microsoft.VisualBasic
Public Class TMHMEditor
Dim TMHMAttacks As Integer
Private Sub TMHMEditor_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim LoopVar As Integer
TMHMAttacks = Int32.Parse((GetString(AppPath & "ini\roms.ini", header, "TMData", "")), System.Globalization.NumberStyles.HexNumber)
TMHMList.Items.Clear()
If GetString(AppPath & "GBAPGESettings.ini", "Settings", "jamboTMextensionHack", "0") = 0 Then
LoopVar = 0
While LoopVar < 58 = True
If LoopVar > 49 Then
TMHMList.Items.Add("HM" & LoopVar - 49 & " - " & 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
End If
If GetString(AppPath & "GBAPGESettings.ini", "Settings", "jamboTMextensionHack", "0") = 1 Then
MsgBox("I'm sorry but this does not support Jambo51's TM/HM hack yet.")
End If
AttackList.Items.Clear()
LoopVar = 0
While LoopVar < (GetString(AppPath & "ini\roms.ini", header, "NumberOfAttacks", "")) + 1 = True
AttackList.Items.Add(GetAttackName(LoopVar))
LoopVar = LoopVar + 1
End While
TMHMList.SelectedIndex = 0
End Sub
Private Sub TMHMList_SelectedIndexChanged(sender As Object, e As EventArgs) Handles TMHMList.SelectedIndexChanged
AttackList.SelectedIndex = Int32.Parse((ReverseHEX(ReadHEX(LoadedROM, TMHMAttacks + ((TMHMList.SelectedIndex) * 2), 2))), System.Globalization.NumberStyles.HexNumber)
End Sub
Private Sub SvBttn_Click(sender As Object, e As EventArgs) Handles SvBttn.Click
Dim indexbuf As Integer
Dim loopvar As Integer
indexbuf = TMHMList.SelectedIndex
WriteHEX(LoadedROM, TMHMAttacks + ((indexbuf) * 2), ReverseHEX(VB.Right("0000" & Hex(AttackList.SelectedIndex), 4)))
TMHMList.Items.Clear()
If GetString(AppPath & "GBAPGESettings.ini", "Settings", "jamboTMextensionHack", "0") = 0 Then
loopvar = 0
While loopvar < 58 = True
If loopvar > 49 Then
TMHMList.Items.Add("HM" & loopvar - 49 & " - " & 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
End If
TMHMList.SelectedIndex = indexbuf
End Sub
End Class

View File

@ -16,7 +16,7 @@
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<dsig:DigestValue>STogN6weQlBLOR+vEzS7Z6OfwP8=</dsig:DigestValue>
<dsig:DigestValue>U6uwjRcEaX8QR5cEYKdWZub64Wo=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>

View File

@ -43,14 +43,14 @@
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="GBAPokemonGameEditor.exe" size="425984">
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="GBAPokemonGameEditor.exe" size="430080">
<assemblyIdentity name="GBAPokemonGameEditor" version="3.1.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>waJWObZlyE6WeJEsWE2s3DjiIr8=</dsig:DigestValue>
<dsig:DigestValue>4McaiERj9WySPDsR1x0ELrBZZ/s=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>

View File

@ -16,7 +16,7 @@
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<dsig:DigestValue>STogN6weQlBLOR+vEzS7Z6OfwP8=</dsig:DigestValue>
<dsig:DigestValue>U6uwjRcEaX8QR5cEYKdWZub64Wo=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>

View File

@ -43,14 +43,14 @@
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="GBAPokemonGameEditor.exe" size="425984">
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="GBAPokemonGameEditor.exe" size="430080">
<assemblyIdentity name="GBAPokemonGameEditor" version="3.1.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>waJWObZlyE6WeJEsWE2s3DjiIr8=</dsig:DigestValue>
<dsig:DigestValue>4McaiERj9WySPDsR1x0ELrBZZ/s=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>

View File

@ -16,7 +16,7 @@
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<dsig:DigestValue>STogN6weQlBLOR+vEzS7Z6OfwP8=</dsig:DigestValue>
<dsig:DigestValue>U6uwjRcEaX8QR5cEYKdWZub64Wo=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>

View File

@ -43,14 +43,14 @@
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="GBAPokemonGameEditor.exe" size="425984">
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="GBAPokemonGameEditor.exe" size="430080">
<assemblyIdentity name="GBAPokemonGameEditor" version="3.1.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>waJWObZlyE6WeJEsWE2s3DjiIr8=</dsig:DigestValue>
<dsig:DigestValue>4McaiERj9WySPDsR1x0ELrBZZ/s=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>

View File

@ -172,3 +172,4 @@ C:\Users\Gamer2020\Documents\GitHub\PokemonGameEditor\GBAPokemonGameEditor\obj\x
C:\Users\Gamer2020\Documents\GitHub\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\GBAPokemonGameEditor.exe
C:\Users\Gamer2020\Documents\GitHub\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\GBAPokemonGameEditor.xml
C:\Users\Gamer2020\Documents\GitHub\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\GBAPokemonGameEditor.pdb
C:\Users\Gamer2020\Documents\GitHub\PokemonGameEditor\GBAPokemonGameEditor\obj\x86\Debug\GBAPokemonGameEditor.TMHMEditor.resources

View File

@ -21,7 +21,7 @@ Ability Editor
Move Tutor Editor
Linux Support - Runs with mono.
Linux Support - Runs with mono. *Please note that I currently can't test under Linux so some things may have become broken since PGE was ableto run on Linux.*
Multiple Windows open at once.
@ -37,6 +37,10 @@ Pokedex Editor
Support for more than 5 evolutions per Pokemon
Support for more types
Ability to define evolutions.
Planned Features
=================
@ -46,12 +50,8 @@ Add item editor.
Ability to add more attacks.
Support for more types
Ability to define types.
Ability to define evolutions.
Implement a way to tag ROMs without actually writing to the ROM in order to use separate inis. Tag should only be applied if needed.
Ability to add more items.