void Init() { //文件路径 this.conflang = MyConfig.GetLanguageFile(this.datapath); //游戏数据,MSE数据 this.datacfg = new DataConfig(MyConfig.GetCardInfoFile(this.datapath)); //初始化YGOUtil的数据 YGOUtil.SetConfig(this.datacfg); //代码提示 string funtxt = MyPath.Combine(this.datapath, MyConfig.FILE_FUNCTION); string conlua = MyPath.Combine(this.datapath, MyConfig.FILE_CONSTANT); string confstring = MyPath.Combine(this.datapath, MyConfig.FILE_STRINGS); this.codecfg = new CodeConfig(); //添加函数 this.codecfg.AddFunction(funtxt); //添加指示物 this.codecfg.AddStrings(confstring); //添加常量 this.codecfg.AddConstant(conlua); this.codecfg.SetNames(this.datacfg.dicSetnames); //生成菜单 this.codecfg.InitAutoMenus(); this.history = new History(this); //读取历史记录 this.history.ReadHistory(MyPath.Combine(this.datapath, MyConfig.FILE_HISTORY)); //加载多语言 LanguageHelper.LoadFormLabels(this.conflang); }
void Init() { //文件路径 conflang = DEXConfig.GetLanguageFile(datapath); //游戏数据,MSE数据 olddatacfg = datacfg = new DataConfig(DEXConfig.GetCardInfoFile(datapath)); string confstring = MyPath.Combine(datapath, DEXConfig.FILE_STRINGS); if (File.Exists(confstring)) { Dictionary <long, string> d = datacfg.dicSetnames; if (!d.ContainsKey(0)) { d.Add(0L, "Archetype"); } foreach (string l in File.ReadAllLines(confstring)) { if (l.StartsWith("!setname")) { string[] sn = l.Split(new char[] { ' ' }, 3); _ = long.TryParse(sn[1], System.Globalization.NumberStyles.HexNumber, null, out long sc); if (!d.ContainsKey(sc)) { d.Add(sc, sn[2]); } } } } //初始化YGOUtil的数据 YGOUtil.SetConfig(datacfg); //代码提示 string funtxt = MyPath.Combine(datapath, DEXConfig.FILE_FUNCTION); string conlua = MyPath.Combine(datapath, DEXConfig.FILE_CONSTANT); codecfg = new CodeConfig(); //添加函数 codecfg.AddFunction(funtxt); //添加指示物 codecfg.AddStrings(confstring); //添加常量 codecfg.AddConstant(conlua); codecfg.SetNames(datacfg.dicSetnames); //生成菜单 codecfg.InitAutoMenus(); history = new History(this); //读取历史记录 history.ReadHistory(MyPath.Combine(datapath, DEXConfig.FILE_HISTORY)); //加载多语言 LanguageHelper.LoadFormLabels(conflang); }