更正Masterdb导出数据类型

This commit is contained in:
Chenx221 2024-10-16 16:35:54 +08:00
parent 79db32b780
commit 34fa4dc9e9
2 changed files with 11 additions and 4 deletions

View File

@ -22,6 +22,8 @@ namespace EscudeTools
public class Record(int columnCount) public class Record(int columnCount)
{ {
public object[] values = new object[columnCount]; // 每列的数据值 public object[] values = new object[columnCount]; // 每列的数据值
//提示
//颜色值转换可以看看https://argb-int-calculator.netlify.app/
} }
public class DatabaseManager public class DatabaseManager
{ {
@ -119,7 +121,15 @@ namespace EscudeTools
} }
else else
{ {
if (sheet.col[j].size == 1)
record.values[j] = sheet_data[offset];
else if (sheet.col[j].size == 2)
record.values[j] = BitConverter.ToInt16(sheet_data, offset);
else if (sheet.col[j].size == 4 && sheet.col[j].type == 1 && sheet.col[j].name == "色") //无奈
record.values[j] = BitConverter.ToUInt32(sheet_data, offset);
else
record.values[j] = BitConverter.ToInt32(sheet_data, offset); record.values[j] = BitConverter.ToInt32(sheet_data, offset);
} }
offset += sheet.col[j].size; //较小概率还有问题 offset += sheet.col[j].size; //较小概率还有问题
} }

View File

@ -71,9 +71,6 @@ namespace EscudeTools
if (!File.Exists(path)) if (!File.Exists(path))
return false; return false;
sf = new ScriptFile(); sf = new ScriptFile();
smEncrypted = false;
name = string.Empty;
messIndex = 0;
name = Path.GetFileNameWithoutExtension(path); name = Path.GetFileNameWithoutExtension(path);
using FileStream fs = new(path, FileMode.Open); using FileStream fs = new(path, FileMode.Open);
using BinaryReader br = new(fs); using BinaryReader br = new(fs);