scripts & contacts export support
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
Imports System.IO
|
||||
Imports System.Text
|
||||
Imports System.Runtime.Remoting.Metadata.W3cXsd2001
|
||||
Imports System.Diagnostics.Eventing
|
||||
|
||||
Public Class ScriptTools
|
||||
|
||||
@@ -160,6 +161,7 @@ Public Class ScriptTools
|
||||
|
||||
ScriptCodes.Add(New CodeObject With {.code = &H87, .value = "_getMney"})
|
||||
|
||||
ScriptCodes.Add(New CodeObject With {.code = &H91, .value = "IncMoney", .descr = "32bit signed"})
|
||||
|
||||
ScriptCodes.Add(New CodeObject With {.code = &H92, .value = "ScrnFade"})
|
||||
|
||||
@@ -172,10 +174,14 @@ Public Class ScriptTools
|
||||
|
||||
ScriptCodes.Add(New CodeObject With {.code = &HC3, .value = "SoundPly", .descr = "ID, Vol"})
|
||||
|
||||
ScriptCodes.Add(New CodeObject With {.code = &HD0, .value = "collLink", .descr = "Sub | bits | 1-act,2-touch | type | collId"})
|
||||
|
||||
ScriptCodes.Add(New CodeObject With {.code = &HD4, .value = "meshMove"})
|
||||
ScriptCodes.Add(New CodeObject With {.code = &HD5, .value = "meshTurn"})
|
||||
ScriptCodes.Add(New CodeObject With {.code = &HD6, .value = "meshWait"})
|
||||
|
||||
ScriptCodes.Add(New CodeObject With {.code = &HD6, .value = "meshHide", .descr = "objID"})
|
||||
|
||||
|
||||
ScriptCodes.Add(New CodeObject With {.code = &HDC, .value = "FXSpLoad"})
|
||||
ScriptCodes.Add(New CodeObject With {.code = &HDD, .value = "FXSprSet"})
|
||||
@@ -364,22 +370,22 @@ Public Class ScriptTools
|
||||
|
||||
|
||||
If skRes = "EOw" Then
|
||||
accum.AddRange({&H6, &H11, &H2, &H11}) 'Its END OF WINDOW
|
||||
Continue Do
|
||||
End If
|
||||
accum.AddRange({&H6, &H11, &H2, &H11}) 'Its END OF WINDOW
|
||||
Continue Do
|
||||
End If
|
||||
|
||||
If skRes = "EndSelection" Then
|
||||
accum.AddRange({&H9, &H11, &H2, &H11, &H3, &H11}) : currentDialog += 1
|
||||
If currentDialog > TextPointers.Count - 1 Then currentDialog -= 1 : Exit Do 'Last DIAL in file
|
||||
f(TextPointers(currentDialog)) = BitConverter.GetBytes(accum.Count)(0)
|
||||
f(TextPointers(currentDialog) + 1) = BitConverter.GetBytes(accum.Count)(1) 'Its NEW LINE
|
||||
If skRes = "EndSelection" Then
|
||||
accum.AddRange({&H9, &H11, &H2, &H11, &H3, &H11}) : currentDialog += 1
|
||||
If currentDialog > TextPointers.Count - 1 Then currentDialog -= 1 : Exit Do 'Last DIAL in file
|
||||
f(TextPointers(currentDialog)) = BitConverter.GetBytes(accum.Count)(0)
|
||||
f(TextPointers(currentDialog) + 1) = BitConverter.GetBytes(accum.Count)(1) 'Its NEW LINE
|
||||
f(TextPointers(currentDialog) + 2) = BitConverter.GetBytes(accum.Count)(2)
|
||||
If tx(x) & tx(x + 1) = vbCrLf Then x += 2 : idsection = True : Continue Do
|
||||
End If
|
||||
|
||||
If skRes = "EOF" Then accum.AddRange({&H6, &H11, &H2, &H11, &H3, &H11}) : Exit Do 'END OF FILE!
|
||||
If skRes = "EOF3" Then accum.AddRange({&H3, &H11}) : Exit Do 'END OF FILE!
|
||||
If skRes = "EOF723" Then accum.AddRange({&H7, &H11, &H2, &H11, &H3, &H11}) : Exit Do 'END OF FILE!
|
||||
If skRes = "EOF" Then accum.AddRange({&H6, &H11, &H2, &H11, &H3, &H11}) : Exit Do 'END OF FILE!
|
||||
If skRes = "EOF3" Then accum.AddRange({&H3, &H11}) : Exit Do 'END OF FILE!
|
||||
If skRes = "EOF723" Then accum.AddRange({&H7, &H11, &H2, &H11, &H3, &H11}) : Exit Do 'END OF FILE!
|
||||
|
||||
|
||||
If skRes = "surname" Then accum.AddRange({&H20, &H11}) : Continue Do '2011 - surname!!!
|
||||
@@ -404,41 +410,41 @@ Public Class ScriptTools
|
||||
End If
|
||||
If skRes = "SelectionMenu" Then accum.AddRange({&H8, &H12}) : Continue Do
|
||||
|
||||
If skRes = "EOw0000" Then accum.AddRange({0, 0}) : Continue Do
|
||||
If skRes = "EOw0000" Then accum.AddRange({0, 0}) : Continue Do
|
||||
|
||||
If skRes.Length = 4 Then 'Try to parse other hex codes
|
||||
accum.AddRange(SoapHexBinary.Parse(skRes).Value.ToList)
|
||||
'x += 2
|
||||
Continue Do
|
||||
If skRes.Length = 4 Then 'Try to parse other hex codes
|
||||
accum.AddRange(SoapHexBinary.Parse(skRes).Value.ToList)
|
||||
'x += 2
|
||||
Continue Do
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
If IsNumeric(skRes) Then
|
||||
accum.AddRange(BitConverter.GetBytes(Convert.ToInt16(skRes)).ToList)
|
||||
Continue Do
|
||||
'Simply Code
|
||||
Else
|
||||
If skRes.Length > 4 Then
|
||||
Dim d As String = skRes
|
||||
If d.Substring(0, 4) = "col=" Then
|
||||
Dim a As Byte = ColorCodes.Find(Function(q) q.value = d.Substring(4)).code 'color command
|
||||
accum.AddRange({&H2E, &H12})
|
||||
accum.AddRange({a, &H0})
|
||||
Continue Do
|
||||
End If
|
||||
|
||||
Dim spec As CodeObject = SpecialCodes.Find(Function(q) q.value = skRes) 'Special code convert IF
|
||||
If Not IsNothing(spec) Then
|
||||
accum.AddRange(BitConverter.GetBytes(Convert.ToInt16(spec.code)).ToList)
|
||||
Continue Do
|
||||
End If
|
||||
If IsNumeric(skRes) Then
|
||||
accum.AddRange(BitConverter.GetBytes(Convert.ToInt16(skRes)).ToList)
|
||||
Continue Do
|
||||
'Simply Code
|
||||
Else
|
||||
If skRes.Length > 4 Then
|
||||
Dim d As String = skRes
|
||||
If d.Substring(0, 4) = "col=" Then
|
||||
Dim a As Byte = ColorCodes.Find(Function(q) q.value = d.Substring(4)).code 'color command
|
||||
accum.AddRange({&H2E, &H12})
|
||||
accum.AddRange({a, &H0})
|
||||
Continue Do
|
||||
End If
|
||||
|
||||
Dim spec As CodeObject = SpecialCodes.Find(Function(q) q.value = skRes) 'Special code convert IF
|
||||
If Not IsNothing(spec) Then
|
||||
accum.AddRange(BitConverter.GetBytes(Convert.ToInt16(spec.code)).ToList)
|
||||
Continue Do
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If tx(x) = vbTab Then
|
||||
If (Form1.CDExtraBtn.Checked) Then
|
||||
@@ -452,7 +458,7 @@ Public Class ScriptTools
|
||||
End If
|
||||
|
||||
If tx(x) & tx(x + 1) = vbCrLf Then accum.AddRange({&H1, &H11}) : LineCount += 1 : x += 2 : Continue Do
|
||||
If tx(x) = vbLf Then accum.AddRange({&H1, &H11}) : LineCount += 1 : x += 1 : Continue Do
|
||||
If tx(x) = vbLf Then accum.AddRange({&H1, &H11}) : LineCount += 1 : x += 1 : Continue Do
|
||||
|
||||
If Form1.NewTextMODE.Checked Then 'Новый режим вывода текста!!!
|
||||
Dim SimpleTextAccum = New List(Of Byte)
|
||||
@@ -479,7 +485,7 @@ Public Class ScriptTools
|
||||
End If
|
||||
Exitif:
|
||||
|
||||
x += 1
|
||||
x += 1
|
||||
Loop While x < tx.Length - 1
|
||||
|
||||
If currentDialog <> TextPointers.Count - 1 Then
|
||||
@@ -939,8 +945,7 @@ endlineTest:
|
||||
|
||||
|
||||
|
||||
Public Function MakeExportFile(ByRef JFile As Byte(), ByRef EFile As Byte(), ByRef cnt As Integer)
|
||||
|
||||
Public Function MakeContactExportFile(ByRef JFile As Byte(), ByRef EFile As Byte(), ByRef cnt As Integer)
|
||||
Dim retString = ""
|
||||
Dim japPointers = New List(Of Integer)
|
||||
Dim engPointers = New List(Of Integer)
|
||||
@@ -948,138 +953,38 @@ endlineTest:
|
||||
Dim EPointersPointer = BitConverter.ToUInt16(EFile, 4)
|
||||
Dim JTextPointer = BitConverter.ToUInt16(JFile, 6)
|
||||
Dim ETextPointer = BitConverter.ToUInt16(EFile, 6)
|
||||
Dim fileHeader = New List(Of Byte)
|
||||
Dim fileHeader = New List(Of Integer)
|
||||
Dim engText = New List(Of String)
|
||||
Dim japText = New List(Of String)
|
||||
'Dim StrCount = (JTextPointer - JPointersPointer) / 2
|
||||
|
||||
'reading pointers
|
||||
Dim pointersReader As Integer = JPointersPointer
|
||||
For a = JPointersPointer To JTextPointer - 1 Step 2 : japPointers.Add(BitConverter.ToUInt16(JFile, a)) : Next a
|
||||
For a = EPointersPointer To ETextPointer - 1 Step 2 : engPointers.Add(BitConverter.ToUInt16(EFile, a)) : Next a
|
||||
'FormFileHeader
|
||||
For a = 0 To ETextPointer - 1 : fileHeader.Add(JFile(a)) : Next
|
||||
For a = 0 To JTextPointer - 1 Step 4 : fileHeader.Add(BitConverter.ToInt32(JFile, a)) : Next
|
||||
|
||||
'reading eng String
|
||||
For a = 0 To engPointers.Count - 1
|
||||
Dim accum = "\\"
|
||||
'Pointer2PointerReading System
|
||||
|
||||
Dim reader As Integer = ETextPointer + engPointers(a)
|
||||
|
||||
Do
|
||||
'If reader >= lastbyte Then Exit Do
|
||||
Dim s = EFile(reader)
|
||||
|
||||
'If reader + 3 < EFile.Count - 1 Then
|
||||
'If s = 6 And EFile(reader + 1) = 2 And EFile(reader + 2) = 3 Then Exit Do
|
||||
If s = 8 Then accum &= "[sel=" & EFile(reader + 1) & "]" : reader += 2 : Continue Do
|
||||
|
||||
If s = 3 Then Exit Do
|
||||
'End If
|
||||
If s = 29 Then accum &= "[c=" & EFile(reader + 1) & "]" : reader += 2 : Continue Do
|
||||
If s = 14 Then accum &= "[0e=" & EFile(reader + 1) & "]" : reader += 2 : Continue Do
|
||||
If s = 30 Then accum &= "[1e=" & EFile(reader + 1) & "]" : reader += 2 : Continue Do
|
||||
If s = 1 Then accum &= vbCrLf & "\\" : reader += 1 : Continue Do
|
||||
If s < 32 Then
|
||||
accum &= "[" & s & "]"
|
||||
Else
|
||||
accum &= Chr(s)
|
||||
End If
|
||||
reader += 1
|
||||
|
||||
Loop While reader < UBound(EFile)
|
||||
Dim accum = ParseContactWindow(EFile, ETextPointer + engPointers(a), True)
|
||||
engText.Add(accum)
|
||||
Next
|
||||
|
||||
'reading jap String
|
||||
For a = 0 To japPointers.Count - 1
|
||||
Dim accum = ""
|
||||
'Pointer2PointerReading System
|
||||
Dim lastbyte As Integer = 0
|
||||
'If a = japPointers.Count - 1 Then
|
||||
' lastbyte = JFile.ToList.Count - 1
|
||||
'Else
|
||||
' lastbyte = japPointers(a + 1) + JTextPointer
|
||||
'End If
|
||||
Dim reader As Integer = JTextPointer + japPointers(a)
|
||||
|
||||
Do
|
||||
'Dim s = JFile(reader)
|
||||
Dim chrr = BitConverter.ToUInt16(JFile, reader) 'Reading 2 Bytes!
|
||||
|
||||
If chrr = &H96E Then accum &= "[man]" : reader += 2 : Continue Do
|
||||
If chrr = &H96F Then accum &= "[woman]" : reader += 2 : Continue Do
|
||||
|
||||
|
||||
If chrr And &H1000 Then
|
||||
'If reader + 7 <= UBound(JFile) - 1 Then
|
||||
' If chrr = &H1101 And BitConverter.ToUInt16(JFile, reader + 2) = &H1106 And
|
||||
' BitConverter.ToUInt16(JFile, reader + 4) = &H1101 And
|
||||
' BitConverter.ToUInt16(JFile, reader + 6) = &H1103 Then accum &= "[END]" : Exit Do
|
||||
'End If
|
||||
|
||||
'If reader + 5 <= lastbyte Then
|
||||
' If chrr = &H1106 And BitConverter.ToUInt16(JFile, reader + 2) = &H1102 And
|
||||
' BitConverter.ToUInt16(JFile, reader + 4) = &H1103 Then accum &= "[END623]" : Exit Do
|
||||
'End If
|
||||
|
||||
If chrr = &H1103 Then accum &= "[0311]" : reader += 2 : Exit Do
|
||||
|
||||
If chrr = &H1205 Then accum &= "[p=" & BitConverter.ToUInt16(JFile, reader + 2) & "]" : reader += 4 : Continue Do
|
||||
If chrr = &H120E Then accum &= "[0e=" & BitConverter.ToUInt16(JFile, reader + 2) & "]" : reader += 4 : Continue Do
|
||||
If chrr = &H121E Then accum &= "[1e=" & BitConverter.ToUInt16(JFile, reader + 2) & "]" : reader += 4 : Continue Do
|
||||
If chrr = &H121D Then accum &= "[c=" & BitConverter.ToUInt16(JFile, reader + 2) & "]" : reader += 4 : Continue Do
|
||||
|
||||
|
||||
If chrr = &H1101 Then accum &= vbCrLf : reader += 2 : Continue Do
|
||||
|
||||
If chrr = &H1120 Then accum &= vbTab : reader += 2 : Continue Do
|
||||
If chrr = &H1121 Then accum &= vbTab : reader += 2 : Continue Do
|
||||
|
||||
Dim c1 = JFile(reader) : Dim c2 = JFile(reader + 1)
|
||||
|
||||
Dim gg = c2 And 15
|
||||
|
||||
For byteskip = 1 To gg
|
||||
accum &= "[" & c1.ToString("X2") & c2.ToString("X2") & "]"
|
||||
reader += 2
|
||||
c1 = JFile(reader) : c2 = JFile(reader + 1)
|
||||
Next
|
||||
Continue Do
|
||||
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Dim aaa = SpecialCodes.Find(Function(q) q.code = chrr)
|
||||
If IsNothing(aaa) Then
|
||||
chrr = chrr And 255 : If chrr < 32 Then chrr += 32
|
||||
accum &= Chr(chrr)
|
||||
|
||||
Else
|
||||
accum &= "[" & aaa.value & "]" 'Если есть специальный код
|
||||
End If
|
||||
|
||||
reader += 2
|
||||
Loop While reader < UBound(JFile)
|
||||
For Each nm In Names
|
||||
accum = accum.Replace(nm.Codes, nm.Dehash)
|
||||
Next
|
||||
|
||||
Dim accum = ParseContactWindow(JFile, JTextPointer + japPointers(a), False)
|
||||
japText.Add(accum)
|
||||
Next
|
||||
|
||||
|
||||
'writing header
|
||||
For Each b In fileHeader
|
||||
retString &= b & ","
|
||||
retString &= $"[" & b.ToString("X4") & "]"
|
||||
Next
|
||||
retString = retString.Substring(0, retString.Length - 1) & vbCrLf
|
||||
|
||||
For a = 0 To japPointers.Count - 1
|
||||
retString &= "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" & vbCrLf
|
||||
retString &= engText(a) & vbCrLf
|
||||
retString &= "[" & a & "]" & vbCrLf
|
||||
retString &= $"[{a}]" & vbCrLf
|
||||
retString &= japText(a) & vbCrLf
|
||||
cnt += 1
|
||||
Next
|
||||
@@ -1088,6 +993,76 @@ endlineTest:
|
||||
Return retString
|
||||
End Function
|
||||
|
||||
Public Function ParseContactWindow(ByRef f As Byte(), ByVal offset As Integer, ByVal isCommented As Boolean)
|
||||
|
||||
Dim accum = ""
|
||||
Dim reader = offset
|
||||
|
||||
Do
|
||||
Dim chrr = BitConverter.ToUInt16(f, reader) 'Reading 2 Bytes!
|
||||
|
||||
'english string
|
||||
If chrr = &H1136 Then
|
||||
reader += 2
|
||||
Dim b = f(reader)
|
||||
Do
|
||||
accum &= Chr(b)
|
||||
reader += 1
|
||||
b = f(reader)
|
||||
Loop While b <> 0
|
||||
reader += 1
|
||||
If reader And 1 Then reader += 1
|
||||
Continue Do
|
||||
End If
|
||||
|
||||
|
||||
If chrr And &H1000 Then
|
||||
If chrr = &H1103 Then accum &= "[0311]" : reader += 2 : Exit Do
|
||||
If chrr = &H1205 Then accum &= "[p=" & BitConverter.ToUInt16(f, reader + 2) & "]" : reader += 4 : Continue Do
|
||||
If chrr = &H120E Then accum &= "[0e=" & BitConverter.ToUInt16(f, reader + 2) & "]" : reader += 4 : Continue Do
|
||||
If chrr = &H121E Then accum &= "[1e=" & BitConverter.ToUInt16(f, reader + 2) & "]" : reader += 4 : Continue Do
|
||||
If chrr = &H121D Then accum &= "[c=" & BitConverter.ToUInt16(f, reader + 2) & "]" : reader += 4 : Continue Do
|
||||
|
||||
|
||||
If chrr = &H1101 Then accum &= vbCrLf : reader += 2 : Continue Do
|
||||
|
||||
If chrr = &H1120 Then accum &= vbTab : reader += 2 : Continue Do
|
||||
If chrr = &H1131 Then accum &= vbTab : reader += 2 : Continue Do
|
||||
|
||||
Dim c1 = f(reader) : Dim c2 = f(reader + 1)
|
||||
|
||||
Dim gg = c2 And 15
|
||||
|
||||
For byteskip = 1 To gg
|
||||
accum &= "[" & c1.ToString("X2") & c2.ToString("X2") & "]"
|
||||
reader += 2
|
||||
c1 = f(reader) : c2 = f(reader + 1)
|
||||
Next
|
||||
Continue Do
|
||||
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Dim aaa = SpecialCodes.Find(Function(q) q.code = chrr)
|
||||
If IsNothing(aaa) Then
|
||||
accum &= Form1.chars(chrr)
|
||||
Else
|
||||
accum &= "[" & aaa.value & "]" 'Если есть специальный код
|
||||
End If
|
||||
|
||||
reader += 2
|
||||
Loop While reader < UBound(f)
|
||||
|
||||
If isCommented Then
|
||||
accum = "\\ " & accum
|
||||
accum = Replace(accum, vbCrLf, vbCrLf & "\\ ")
|
||||
End If
|
||||
|
||||
Return accum
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
Public Sub importContactFile(ByVal inputJfile As String, ByRef DialCount As Integer, ByRef LineCount As Integer)
|
||||
|
||||
@@ -1280,133 +1255,58 @@ endlineTest:
|
||||
Public Function MakeSummonExport(ByRef JFile As Byte(), ByRef EFile As Byte(), ByRef cnt As Integer)
|
||||
|
||||
|
||||
Dim retString = ""
|
||||
|
||||
Dim engText = New List(Of String)
|
||||
Dim japText = New List(Of String)
|
||||
'Dim StrCount = (JTextPointer - JPointersPointer) / 2
|
||||
|
||||
'reading pointers
|
||||
|
||||
Dim accum = "\\"
|
||||
'Pointer2PointerReading System
|
||||
|
||||
Dim reader As Integer = 0
|
||||
|
||||
Do
|
||||
'If reader >= lastbyte Then Exit Do
|
||||
Dim s = EFile(reader)
|
||||
|
||||
'If reader + 3 < EFile.Count - 1 Then
|
||||
'If s = 6 And EFile(reader + 1) = 2 And EFile(reader + 2) = 3 Then Exit Do
|
||||
If s = 8 Then accum &= "[sel=" & EFile(reader + 1) & "]" : reader += 2 : Continue Do
|
||||
|
||||
If s = 3 Then Exit Do
|
||||
'End If
|
||||
If s = 29 Then accum &= "[c=" & EFile(reader + 1) & "]" : reader += 2 : Continue Do
|
||||
If s = 14 Then accum &= "[0e=" & EFile(reader + 1) & "]" : reader += 2 : Continue Do
|
||||
If s = 30 Then accum &= "[1e=" & EFile(reader + 1) & "]" : reader += 2 : Continue Do
|
||||
If s = 1 Then accum &= vbCrLf & "\\" : reader += 1 : Continue Do
|
||||
If s < 32 Then
|
||||
accum &= "[" & s & "]"
|
||||
Else
|
||||
accum &= Chr(s)
|
||||
End If
|
||||
reader += 1
|
||||
|
||||
Loop While reader < UBound(EFile)
|
||||
engText.Add(accum)
|
||||
|
||||
|
||||
'reading jap String
|
||||
|
||||
accum = ""
|
||||
'Pointer2PointerReading System
|
||||
Dim lastbyte As Integer = 0
|
||||
'If a = japPointers.Count - 1 Then
|
||||
' lastbyte = JFile.ToList.Count - 1
|
||||
'Else
|
||||
' lastbyte = japPointers(a + 1) + JTextPointer
|
||||
'End If
|
||||
reader = 0
|
||||
|
||||
Do
|
||||
'Dim s = JFile(reader)
|
||||
Dim chrr = BitConverter.ToUInt16(JFile, reader) 'Reading 2 Bytes!
|
||||
|
||||
If chrr = &H96E Then accum &= "[man]" : reader += 2 : Continue Do
|
||||
If chrr = &H96F Then accum &= "[woman]" : reader += 2 : Continue Do
|
||||
|
||||
|
||||
If chrr And &H1000 Then
|
||||
|
||||
|
||||
If chrr = &H1103 Then accum &= "[311]" : reader += 2 : Exit Do
|
||||
|
||||
If chrr = &H1205 Then accum &= "[p=" & BitConverter.ToUInt16(JFile, reader + 2) & "]" : reader += 4 : Continue Do
|
||||
If chrr = &H120E Then accum &= "[0e=" & BitConverter.ToUInt16(JFile, reader + 2) & "]" : reader += 4 : Continue Do
|
||||
If chrr = &H121E Then accum &= "[1e=" & BitConverter.ToUInt16(JFile, reader + 2) & "]" : reader += 4 : Continue Do
|
||||
If chrr = &H121D Then accum &= "[c=" & BitConverter.ToUInt16(JFile, reader + 2) & "]" : reader += 4 : Continue Do
|
||||
|
||||
|
||||
If chrr = &H1101 Then accum &= vbCrLf : reader += 2 : Continue Do
|
||||
|
||||
If chrr = &H1120 Then accum &= vbTab : reader += 2 : Continue Do
|
||||
If chrr = &H1121 Then accum &= vbTab : reader += 2 : Continue Do
|
||||
|
||||
Dim c1 = JFile(reader) : Dim c2 = JFile(reader + 1)
|
||||
|
||||
Dim gg = c2 And 15
|
||||
|
||||
For byteskip = 1 To gg
|
||||
accum &= "[" & c1.ToString("X2") & c2.ToString("X2") & "]"
|
||||
reader += 2
|
||||
c1 = JFile(reader) : c2 = JFile(reader + 1)
|
||||
Next
|
||||
Continue Do
|
||||
|
||||
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Dim aaa = SpecialCodes.Find(Function(q) q.code = chrr)
|
||||
If IsNothing(aaa) Then
|
||||
chrr = chrr And 255 : If chrr < 32 Then chrr += 32
|
||||
accum &= Chr(chrr)
|
||||
|
||||
Else
|
||||
accum &= "[" & aaa.value & "]" 'Если есть специальный код
|
||||
End If
|
||||
|
||||
reader += 2
|
||||
Loop While reader < UBound(JFile)
|
||||
For Each nm In Names
|
||||
accum = accum.Replace(nm.Codes, nm.Dehash)
|
||||
Next
|
||||
|
||||
japText.Add(accum)
|
||||
|
||||
|
||||
|
||||
|
||||
' retString = retString.Substring(0, retString.Length - 1) & vbCrLf
|
||||
|
||||
|
||||
retString &= "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" & vbCrLf
|
||||
retString &= engText(0) & vbCrLf
|
||||
retString &= "[0]" & vbCrLf
|
||||
retString &= japText(0) & vbCrLf
|
||||
cnt += 1
|
||||
|
||||
Replace(retString, "[0611][0211][311]", "[END623]")
|
||||
|
||||
Return retString
|
||||
|
||||
Return makeSummonUniversalLine(EFile, True) & vbCrLf & makeSummonUniversalLine(JFile, False)
|
||||
|
||||
|
||||
End Function
|
||||
Public Function makeSummonUniversalLine(ByVal inputBytes As Byte(), commented As Boolean)
|
||||
|
||||
Dim reader As Integer = 0
|
||||
Dim str = If(commented, "// ", "")
|
||||
|
||||
Do While reader < UBound(inputBytes)
|
||||
Dim code = BitConverter.ToInt16(inputBytes, reader)
|
||||
reader += 2
|
||||
|
||||
If code = &H1136 Then
|
||||
'reading english text
|
||||
Do
|
||||
Dim ch = inputBytes(reader)
|
||||
If ch = 0 Then reader += 1 : Exit Do
|
||||
str &= Chr(ch)
|
||||
reader += 1
|
||||
Loop
|
||||
If reader And 1 Then reader += 1
|
||||
Continue Do
|
||||
End If
|
||||
|
||||
If code And &H1000 Then
|
||||
|
||||
If code = &H1101 Then str &= vbCrLf & If(commented, "// ", "") : Continue Do
|
||||
If code = &H1131 Then str &= vbTab : Continue Do
|
||||
|
||||
Dim hex = code.ToString("X4")
|
||||
str &= $"[{hex}]"
|
||||
|
||||
Dim cmdLength = (code And &HF00) >> 8
|
||||
If cmdLength > 1 Then
|
||||
For a = 1 To cmdLength - 1
|
||||
code = BitConverter.ToInt16(inputBytes, reader)
|
||||
hex = code.ToString("X4")
|
||||
str &= $"[{hex}]"
|
||||
reader += 2
|
||||
Next
|
||||
|
||||
End If
|
||||
Else
|
||||
str &= Form1.chars(code)
|
||||
End If
|
||||
Loop
|
||||
|
||||
Return str
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
Public Sub convertSummonScript(ByVal inputJfile As String, ByRef DialCount As Integer)
|
||||
|
||||
@@ -1544,65 +1444,6 @@ endlineTest:
|
||||
End Sub
|
||||
Public Sub ConvertForEdit(srcFile As String, destFile As String)
|
||||
|
||||
Dim txt = My.Computer.FileSystem.ReadAllText(srcFile, Encoding.GetEncoding(1251))
|
||||
Dim destText = ""
|
||||
Dim accum = ""
|
||||
Dim x = 0
|
||||
|
||||
Dim t As List(Of String) = Split(Split(txt, "-----TEXT SECTION" & vbCrLf)(1), vbCrLf).ToList
|
||||
Dim idsection As Boolean = True
|
||||
|
||||
For Each tx In t
|
||||
x = 0
|
||||
If tx.Length < 2 Then Continue For
|
||||
If tx(x) = "\" And tx(x + 1) = "\" Then
|
||||
idsection = True
|
||||
Continue For
|
||||
End If
|
||||
|
||||
Do
|
||||
|
||||
If tx(x) = "[" Then
|
||||
Dim skRes = getFromSkobki(tx, x)
|
||||
If IsNumeric(skRes) And idsection Then
|
||||
idsection = False
|
||||
destText &= "[" & skRes & "]" & vbCrLf
|
||||
Continue For 'its simple ID
|
||||
End If
|
||||
|
||||
If skRes = "END623" Or skRes = "END" Or skRes = "311" Or skRes = "EOF" Or skRes = "EOD3" Or skRes = "EndSelection" Then
|
||||
|
||||
destText &= accum & vbCrLf
|
||||
accum = ""
|
||||
idsection = True
|
||||
Continue For
|
||||
End If
|
||||
|
||||
If skRes = "EOw" Then accum &= vbCrLf
|
||||
|
||||
If skRes = "SelectionMenu" Then accum &= " --[выбор]" & vbCrLf
|
||||
|
||||
If skRes = "name" Then destText &= "Тацуя"
|
||||
If skRes = "surname" Then destText &= "Суоу"
|
||||
|
||||
|
||||
Continue Do
|
||||
|
||||
End If
|
||||
If tx(x) = vbTab Then accum &= " " : x += 1 : Continue Do
|
||||
If tx(x) = "~" Then accum &= "..." : x += 1 : Continue Do
|
||||
|
||||
accum &= tx(x)
|
||||
x = x + 1
|
||||
Loop While x < tx.Length
|
||||
|
||||
destText &= accum & vbCrLf
|
||||
accum = ""
|
||||
|
||||
Next
|
||||
|
||||
My.Computer.FileSystem.WriteAllText(destFile, destText, False)
|
||||
|
||||
End Sub
|
||||
Public Function makeCRCString(ByRef bts As List(Of Byte))
|
||||
Dim a = ""
|
||||
@@ -1736,7 +1577,7 @@ endlineTest:
|
||||
Dim d = New ScriptParserWin
|
||||
d.Text = Path.GetFileNameWithoutExtension(inputJfile)
|
||||
d.TextBox1.Text = ExportText
|
||||
d.ShowDialog()
|
||||
d.Show()
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Reference in New Issue
Block a user