Example #1
0
 public static void SetConfig(DataConfig dcfg)
 {
     datacfg = dcfg;
 }
Example #2
0
 //初始化控件
 public void InitControl(DataConfig datacfg)
 {
     if (datacfg == null)
         return;
     //选择框
     InitComboBox(cb_cardrace, datacfg.dicCardRaces);
     InitComboBox(cb_cardattribute, datacfg.dicCardAttributes);
     InitComboBox(cb_cardrule, datacfg.dicCardRules);
     InitComboBox(cb_cardlevel, datacfg.dicCardLevels);
     //卡片类型
     InitCheckPanel(pl_cardtype, datacfg.dicCardTypes);
     //效果类型
     InitCheckPanel(pl_category, datacfg.dicCardcategorys);
     //系列名
     List<long> setcodes = DataManager.GetKeys(datacfg.dicSetnames);
     string[] setnames = DataManager.GetValues(datacfg.dicSetnames);
     InitComboBox(cb_setname1, setcodes, setnames);
     InitComboBox(cb_setname2, setcodes, setnames);
     InitComboBox(cb_setname3, setcodes, setnames);
     InitComboBox(cb_setname4, setcodes, setnames);
     //
 }
Example #3
0
 static YGOUtil()
 {
     datacfg = new DataConfig();
 }
Example #4
0
        void Init()
        {
            //文件路径
            conflang = MyConfig.GetLanguageFile(datapath);
            //游戏数据,MSE数据
            datacfg = new DataConfig(MyConfig.GetCardInfoFile(datapath));
            //初始化YGOUtil的数据
            YGOUtil.SetConfig(datacfg);

            //代码提示
            string funtxt = MyPath.Combine(datapath, MyConfig.FILE_FUNCTION);
            string conlua = MyPath.Combine(datapath, MyConfig.FILE_CONSTANT);
            string confstring = MyPath.Combine(datapath, MyConfig.FILE_STRINGS);
            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, MyConfig.FILE_HISTORY));
            //加载多语言
            LanguageHelper.LoadFormLabels(conflang);
        }