Commit 3b3738ad authored by mercury233's avatar mercury233

add parameter

Usage: ImgGen.exe [path to database.cdb] [translation of XYZ]
Sample: ImgGen.exe  ..\expansions\pre-release.cdb XYZ
parent 54eed964
......@@ -16,7 +16,7 @@ namespace ImgGen
private static Dictionary<int, Data> cardDatas = new Dictionary<int, Data>();
private static Dictionary<int, Bitmap> cardImages = new Dictionary<int, Bitmap>();
private static Dictionary<int, Text> cardTexts = new Dictionary<int, Text>();
private static SQLiteConnection conn = new SQLiteConnection("Data Source=../cards.cdb");
private static SQLiteConnection conn;
private static Dictionary<int, string> ctStrings = new Dictionary<int, string>();
private static object locker = new object();
private static SolidBrush nameBrush = new SolidBrush(Color.FromArgb(0x40, 0x40, 0));
......@@ -31,6 +31,7 @@ namespace ImgGen
private static string regex_monster = @"[果|介|述|報]】\n([\S\s]*)";
private static string regex_pendulum = @"】[\s\S]*?\n([\S\s]*?)\n【";
private static string xyzString = "超量";
public static Data GetCardData(int code)
{
......@@ -202,7 +203,7 @@ namespace ImgGen
{
if ((dat.type & 0x800000) != 0)
{
str = str + "/超量";
str = str + "/" + xyzString;
}
else if ((dat.type & 0x2000) != 0)
{
......@@ -252,8 +253,10 @@ namespace ImgGen
return (str + "】");
}
public static void InitialDatas()
public static void InitialDatas(string dbPath= "../cards.cdb", string xyz="超量")
{
xyzString = xyz;
conn = new SQLiteConnection("Data Source=" + dbPath);
numFont = new Font("Arial", 5.5f);
nameFont = new Font("文泉驿微米黑", 10f);
typeFont = new Font("文泉驿微米黑", 6f);
......
......@@ -22,7 +22,18 @@
private static void Main(string[] args)
{
DataManager.InitialDatas();
if (args.Length > 1)
{
DataManager.InitialDatas(args[0], args[1]);
}
else if (args.Length > 0)
{
DataManager.InitialDatas(args[0]);
}
else
{
DataManager.InitialDatas();
}
Encoder quality = Encoder.Quality;
ImageCodecInfo encoderInfo = GetEncoderInfo("image/jpeg");
EncoderParameters encoderParams = new EncoderParameters(1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment