【调整】为了避免使人疑惑,强迫excel定义enum类型时,必须填写value值(而xml中可不填,默认使用c语言的值递增规则)。

main
walon 2021-08-05 10:42:16 +08:00
parent 714f731f99
commit a19b17d7ed
1 changed files with 2 additions and 2 deletions

View File

@ -527,7 +527,7 @@ namespace Luban.Job.Cfg.Defs
new CfgField() { Name = "full_name", Type = "string" },
new CfgField() { Name = "item", Type = "string" },
new CfgField() { Name = "alias", Type = "string" },
new CfgField() { Name = "value", Type = "string" },
new CfgField() { Name = "value", Type = "int" },
new CfgField() { Name = "comment", Type = "string" },
}
})
@ -570,7 +570,7 @@ namespace Luban.Job.Cfg.Defs
throw new Exception($"file:{file.ActualFile} module:'{module}' name:'{name}' 定义了一个空枚举项");
}
string alias = (data.GetField("alias") as DString).Value.Trim();
string value = (data.GetField("value") as DString).Value.Trim();
string value = (data.GetField("value") as DInt).Value.ToString();
string comment = (data.GetField("comment") as DString).Value.Trim();
curEnum.Items.Add(new EnumItem() { Name = item, Alias = alias, Value = value, Comment = comment });
};