Char contacts convert & import
This commit is contained in:
@@ -958,7 +958,6 @@ endlineTest:
|
||||
Dim japText = New List(Of String)
|
||||
|
||||
'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
|
||||
@@ -1066,7 +1065,7 @@ endlineTest:
|
||||
End Function
|
||||
|
||||
|
||||
Public Sub importContactFile(ByVal inputJfile As String, ByRef DialCount As Integer, ByRef LineCount As Integer)
|
||||
Public Sub ConvertTXT_To_Contact(ByVal inputJfile As String, ByRef DialCount As Integer, ByRef LineCount As Integer)
|
||||
|
||||
Dim f = New List(Of Byte)
|
||||
Dim TextPointers = New List(Of Integer)
|
||||
@@ -1077,16 +1076,22 @@ endlineTest:
|
||||
|
||||
'Recompiling scripts
|
||||
|
||||
|
||||
Dim cleanedString = t(0).Trim({"["c, "]"c})
|
||||
Dim hexValues = cleanedString.Split(New String() {"]["}, StringSplitOptions.None)
|
||||
|
||||
'Init
|
||||
Dim t1 = Split(t(0), ",").ToList
|
||||
For Each ii In t1
|
||||
If Not IsNumeric(ii) Then MsgBox("Not numeric in INIT sect!!") : Exit Sub
|
||||
f.Add(Convert.ToByte(ii))
|
||||
For Each hexValue In hexValues
|
||||
Dim intValue = Integer.Parse(hexValue, System.Globalization.NumberStyles.HexNumber)
|
||||
Dim bytes = BitConverter.GetBytes(intValue)
|
||||
f.AddRange(bytes)
|
||||
Next
|
||||
|
||||
Dim JPointersPointer = f(4) + f(5) * 256
|
||||
Dim JTextPointer = f(6) + f(7) * 256
|
||||
Dim StrCount = (JTextPointer - JPointersPointer) / 2
|
||||
If f.Count > JTextPointer Then f.RemoveRange(JTextPointer, 2)
|
||||
|
||||
Dim tx As String = txt.Replace(t(0) & vbCrLf, "") 'Replace first line
|
||||
|
||||
@@ -1123,7 +1128,7 @@ endlineTest:
|
||||
End If
|
||||
|
||||
|
||||
If skRes = "END623" Or skRes = "END" Or skRes = "311" Then
|
||||
If skRes = "END623" Or skRes = "END" Or skRes = "0311" Then
|
||||
Dim curCount = accum.Count
|
||||
currentDialog += 1
|
||||
x += 2
|
||||
@@ -1132,7 +1137,7 @@ endlineTest:
|
||||
TempLinesAccum.AddRange({&H6, &H11, &H2, &H11, &H3, &H11})
|
||||
Case "END"
|
||||
TempLinesAccum.AddRange({&H6, &H11, &H3, &H11})
|
||||
Case "311"
|
||||
Case "0311"
|
||||
TempLinesAccum.AddRange({&H3, &H11})
|
||||
End Select
|
||||
|
||||
@@ -1189,7 +1194,7 @@ endlineTest:
|
||||
End If
|
||||
|
||||
|
||||
If tx(x) = vbTab Then TempLinesAccum.AddRange({&H1, &H11}) : x += 1 : Continue Do 'Tab and enter
|
||||
If tx(x) = vbTab Then TempLinesAccum.AddRange({&H31, &H11}) : x += 1 : Continue Do 'Tab and enter
|
||||
If tx(x) & tx(x + 1) = vbCrLf Then TempLinesAccum.AddRange({&H1, &H11}) : LineCount += 1 : x += 2 : Continue Do
|
||||
If tx(x) = vbLf Then TempLinesAccum.AddRange({&H1, &H11}) : LineCount += 1 : x += 1 : Continue Do
|
||||
|
||||
|
||||
Reference in New Issue
Block a user