diff --git a/.vs/GBAPokemonGameEditor/v14/.suo b/.vs/GBAPokemonGameEditor/v14/.suo index a4c9ae3..dc4d65c 100644 Binary files a/.vs/GBAPokemonGameEditor/v14/.suo and b/.vs/GBAPokemonGameEditor/v14/.suo differ diff --git a/GBAPokemonGameEditor/AbilityEdit.Designer.vb b/GBAPokemonGameEditor/AbilityEdit.Designer.vb index 88c96a6..002728d 100644 --- a/GBAPokemonGameEditor/AbilityEdit.Designer.vb +++ b/GBAPokemonGameEditor/AbilityEdit.Designer.vb @@ -24,6 +24,7 @@ Partial Class AbilityEdit Private Sub InitializeComponent() Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(AbilityEdit)) Me.GroupBox1 = New System.Windows.Forms.GroupBox() + Me.AbilityList = New System.Windows.Forms.ComboBox() Me.Label1 = New System.Windows.Forms.Label() Me.AbilityIndexTextBox = New System.Windows.Forms.TextBox() Me.GroupBox2 = New System.Windows.Forms.GroupBox() @@ -33,7 +34,8 @@ Partial Class AbilityEdit Me.TextBox3 = New System.Windows.Forms.TextBox() Me.Button2 = New System.Windows.Forms.Button() Me.TextBox2 = New System.Windows.Forms.TextBox() - Me.AbilityList = New System.Windows.Forms.ComboBox() + Me.Label21 = New System.Windows.Forms.Label() + Me.Button6 = New System.Windows.Forms.Button() Me.GroupBox1.SuspendLayout() Me.GroupBox2.SuspendLayout() Me.GroupBox3.SuspendLayout() @@ -51,6 +53,16 @@ Partial Class AbilityEdit Me.GroupBox1.TabStop = False Me.GroupBox1.Text = "Ability Selection" ' + 'AbilityList + ' + Me.AbilityList.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend + Me.AbilityList.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems + Me.AbilityList.FormattingEnabled = True + Me.AbilityList.Location = New System.Drawing.Point(6, 22) + Me.AbilityList.Name = "AbilityList" + Me.AbilityList.Size = New System.Drawing.Size(121, 21) + Me.AbilityList.TabIndex = 0 + ' 'Label1 ' Me.Label1.AutoSize = True @@ -74,7 +86,7 @@ Partial Class AbilityEdit Me.GroupBox2.Controls.Add(Me.TextBox1) Me.GroupBox2.Location = New System.Drawing.Point(12, 108) Me.GroupBox2.Name = "GroupBox2" - Me.GroupBox2.Size = New System.Drawing.Size(134, 83) + Me.GroupBox2.Size = New System.Drawing.Size(134, 113) Me.GroupBox2.TabIndex = 3 Me.GroupBox2.TabStop = False Me.GroupBox2.Text = "Name" @@ -97,12 +109,14 @@ Partial Class AbilityEdit ' 'GroupBox3 ' + Me.GroupBox3.Controls.Add(Me.Label21) + Me.GroupBox3.Controls.Add(Me.Button6) Me.GroupBox3.Controls.Add(Me.TextBox3) Me.GroupBox3.Controls.Add(Me.Button2) Me.GroupBox3.Controls.Add(Me.TextBox2) Me.GroupBox3.Location = New System.Drawing.Point(163, 13) Me.GroupBox3.Name = "GroupBox3" - Me.GroupBox3.Size = New System.Drawing.Size(210, 178) + Me.GroupBox3.Size = New System.Drawing.Size(210, 208) Me.GroupBox3.TabIndex = 4 Me.GroupBox3.TabStop = False Me.GroupBox3.Text = "Description" @@ -112,7 +126,6 @@ Partial Class AbilityEdit Me.TextBox3.Location = New System.Drawing.Point(12, 57) Me.TextBox3.Multiline = True Me.TextBox3.Name = "TextBox3" - Me.TextBox3.ReadOnly = True Me.TextBox3.ScrollBars = System.Windows.Forms.ScrollBars.Both Me.TextBox3.Size = New System.Drawing.Size(174, 96) Me.TextBox3.TabIndex = 2 @@ -133,21 +146,30 @@ Partial Class AbilityEdit Me.TextBox2.Size = New System.Drawing.Size(90, 20) Me.TextBox2.TabIndex = 0 ' - 'AbilityList + 'Label21 ' - Me.AbilityList.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend - Me.AbilityList.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems - Me.AbilityList.FormattingEnabled = True - Me.AbilityList.Location = New System.Drawing.Point(6, 22) - Me.AbilityList.Name = "AbilityList" - Me.AbilityList.Size = New System.Drawing.Size(121, 21) - Me.AbilityList.TabIndex = 0 + Me.Label21.AutoSize = True + Me.Label21.ForeColor = System.Drawing.SystemColors.ControlText + Me.Label21.Location = New System.Drawing.Point(9, 156) + Me.Label21.Name = "Label21" + Me.Label21.Size = New System.Drawing.Size(43, 13) + Me.Label21.TabIndex = 31 + Me.Label21.Text = "Length:" + ' + 'Button6 + ' + Me.Button6.Location = New System.Drawing.Point(119, 172) + Me.Button6.Name = "Button6" + Me.Button6.Size = New System.Drawing.Size(67, 20) + Me.Button6.TabIndex = 30 + Me.Button6.Text = "Save" + Me.Button6.UseVisualStyleBackColor = True ' 'AbilityEdit ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(385, 198) + Me.ClientSize = New System.Drawing.Size(385, 227) Me.Controls.Add(Me.GroupBox3) Me.Controls.Add(Me.GroupBox2) Me.Controls.Add(Me.GroupBox1) @@ -177,4 +199,6 @@ Partial Class AbilityEdit Friend WithEvents Label1 As Label Friend WithEvents AbilityIndexTextBox As TextBox Friend WithEvents AbilityList As ComboBox + Friend WithEvents Label21 As Label + Friend WithEvents Button6 As Button End Class diff --git a/GBAPokemonGameEditor/AbilityEdit.vb b/GBAPokemonGameEditor/AbilityEdit.vb index d2a42e1..48aca3c 100644 --- a/GBAPokemonGameEditor/AbilityEdit.vb +++ b/GBAPokemonGameEditor/AbilityEdit.vb @@ -1,5 +1,6 @@ Public Class AbilityEdit Dim AbilityDesc As Integer + Dim CurrentAbilityDescripLength As Integer Private Sub AbilityEdit_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed MainFrm.Visible = True @@ -83,9 +84,90 @@ DexDescp = Mid$(DexDescp, 1, InStr(1, DexDescp, "\x")) DexDescp = Replace(DexDescp, "\n", vbCrLf) DexDescp = Replace(RTrim$(DexDescp), "\", "") + CurrentAbilityDescripLength = Len(DexDescp) TextBox3.Text = DexDescp - TextBox3.MaxLength = Len(DexDescp) FileClose(FileNum) + + + + End Sub + + Private Sub TextBox3_TextChanged(sender As Object, e As EventArgs) Handles TextBox3.TextChanged + Label21.Text = "Length: " & Len(TextBox3.Text) & "/" & CurrentAbilityDescripLength + Label21.ForeColor = Color.Black + + If Len(TextBox3.Text) > CurrentAbilityDescripLength Then + Label21.Text = Label21.Text & " Requires repoint!" + + Label21.ForeColor = Color.Red + + End If + End Sub + + Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click + Dim curdespoff As String + + Dim destowrite As String + + curdespoff = Hex(Val("&H" & ReverseHEX(ReadHEX(LoadedROM, (AbilityDesc) + (AbilityList.SelectedIndex * 4), 4))) - &H8000000) + + destowrite = Asc2Sapp(Replace(TextBox3.Text, vbCrLf, "\n") & "\x") + + + + If Len(TextBox3.Text) > CurrentAbilityDescripLength Then + + + Dim result As DialogResult = MessageBox.Show("The text 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 newtextoff As String + + newtextoff = SearchFreeSpaceFourAligned(LoadedROM, &HFF, (Len(destowrite & " ")), "&H" & GetString(GetINIFileLocation(), header, "StartSearchingForSpaceOffset", "800000")) + + FileNum = FreeFile() + + FileOpen(FileNum, LoadedROM, OpenMode.Binary) + + FilePut(FileNum, destowrite & " ", ("&H" & Hex(newtextoff)) + 1, False) + + FileClose(FileNum) + + TextBox2.Text = Hex(newtextoff) + + Button2.PerformClick() + + Label21.Text = "Length: " & Len(TextBox3.Text) & "/" & CurrentAbilityDescripLength + Label21.ForeColor = Color.Black + + If Len(TextBox3.Text) > CurrentAbilityDescripLength Then + Label21.Text = Label21.Text & " Requires repoint!" + + Label21.ForeColor = Color.Red + + End If + + Else + + End If + + Else + + + FileNum = FreeFile() + + FileOpen(FileNum, LoadedROM, OpenMode.Binary) + + FilePut(FileNum, destowrite, ("&H" & curdespoff) + 1, False) + + FileClose(FileNum) + + TextBox2.Text = curdespoff + + End If End Sub End Class \ No newline at end of file diff --git a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.application b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.application index f4d8b5f..30a8ab0 100644 --- a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.application +++ b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.application @@ -16,7 +16,7 @@ - PoPChwn6Uv+GQRKkvz4LdV//0BM= + QXbsJUSt7zEqcwyu4f9qTclSKLk= diff --git a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.exe b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.exe index 1ef4bf1..3a8840f 100644 Binary files a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.exe and b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.exe differ diff --git a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.exe.manifest b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.exe.manifest index 1b580f2..eba6d7b 100644 --- a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.exe.manifest +++ b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.exe.manifest @@ -43,14 +43,14 @@ - + - T45A1rQN60iD0gCcqkGA9V79nhU= + 4g4MnS03k1DDsta0wOovUeCbvEU= diff --git a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.pdb b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.pdb index 82ff86c..8639d52 100644 Binary files a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.pdb and b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.pdb differ diff --git a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.vshost.application b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.vshost.application index f4d8b5f..30a8ab0 100644 --- a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.vshost.application +++ b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.vshost.application @@ -16,7 +16,7 @@ - PoPChwn6Uv+GQRKkvz4LdV//0BM= + QXbsJUSt7zEqcwyu4f9qTclSKLk= diff --git a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.vshost.exe.manifest b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.vshost.exe.manifest index 1b580f2..eba6d7b 100644 --- a/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.vshost.exe.manifest +++ b/GBAPokemonGameEditor/bin/Debug/PokemonGameEditor.vshost.exe.manifest @@ -43,14 +43,14 @@ - + - T45A1rQN60iD0gCcqkGA9V79nhU= + 4g4MnS03k1DDsta0wOovUeCbvEU= diff --git a/GBAPokemonGameEditor/bin/Debug/app.publish/PokemonGameEditor.exe b/GBAPokemonGameEditor/bin/Debug/app.publish/PokemonGameEditor.exe index 1ef4bf1..3a8840f 100644 Binary files a/GBAPokemonGameEditor/bin/Debug/app.publish/PokemonGameEditor.exe and b/GBAPokemonGameEditor/bin/Debug/app.publish/PokemonGameEditor.exe differ diff --git a/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.vbproj.GenerateResource.Cache b/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.vbproj.GenerateResource.Cache index 1d70904..0a7d072 100644 Binary files a/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.vbproj.GenerateResource.Cache and b/GBAPokemonGameEditor/obj/x86/Debug/GBAPokemonGameEditor.vbproj.GenerateResource.Cache differ diff --git a/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.application b/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.application index f4d8b5f..30a8ab0 100644 --- a/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.application +++ b/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.application @@ -16,7 +16,7 @@ - PoPChwn6Uv+GQRKkvz4LdV//0BM= + QXbsJUSt7zEqcwyu4f9qTclSKLk= diff --git a/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.exe b/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.exe index 1ef4bf1..3a8840f 100644 Binary files a/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.exe and b/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.exe differ diff --git a/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.exe.manifest b/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.exe.manifest index 1b580f2..eba6d7b 100644 --- a/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.exe.manifest +++ b/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.exe.manifest @@ -43,14 +43,14 @@ - + - T45A1rQN60iD0gCcqkGA9V79nhU= + 4g4MnS03k1DDsta0wOovUeCbvEU= diff --git a/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.pdb b/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.pdb index 82ff86c..8639d52 100644 Binary files a/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.pdb and b/GBAPokemonGameEditor/obj/x86/Debug/PokemonGameEditor.pdb differ