Exemple #1
0
        private void LoadConfig()
        {
            LuaConfigs.LoadSingleConfig <MainConfig>("mainconfig.lua");
            LoadGenerateConfig();

            SearchSelect.Items.Clear();
            SearchSelect.ItemsSource   = MainConfig.Instance.searchMenus;
            SearchSelect.SelectedIndex = 0;

            this.MinWidth  = MainConfig.Instance.winMinWidth;
            this.MinHeight = MainConfig.Instance.winMinHeight;
            ((TabItem)TabIndex.Items[0]).Header = MainConfig.Instance.muluText;
            ((TabItem)TabIndex.Items[1]).Header = MainConfig.Instance.searchText;
        }
Exemple #2
0
        static void test1()
        {
            var config = LuaConfigs.LoadSingleConfig <TestAttrConfig>("test_bak.lua");

            config.WriteToFile("test.lua");
            Console.WriteLine(config.ToLuaString());
            var initattr = LuaConfigs.LoadSingleConfig <InitAttr>("init.lua");

            Console.WriteLine(config.ToString());
            Console.WriteLine(initattr.ToString());
            TestAttrBase tb = new TestAttrBase(config);

            tb.AddAttributes(initattr.init_attr);
            print(tb, "BEF");
            tb.Rebuild(true);
            print(tb, "AFT");

            Console.WriteLine("adddddddddddddddddddd");
            tb.AddAttribute(ATTR_ID.AGILITY_ABL, 1);
            tb.Rebuild();
            print(tb, "ADD1");
            tb.AddAttribute(ATTR_ID.STRENGTH_ABL, 1);
            tb.Rebuild();
            print(tb, "ADD2");

            Console.WriteLine("removeeeeeeeeeeeeeeeee");
            tb.RemoveAttribute(ATTR_ID.AGILITY_ABL, 1);
            tb.Rebuild();
            print(tb, "REM1");
            tb.RemoveAttribute(ATTR_ID.STRENGTH_ABL, 1);
            tb.Rebuild();
            print(tb, "REM2");

            Console.WriteLine("addlistttttttttttttttttt");
            var attList = new Dictionary <ATTR_ID, double> {
                { ATTR_ID.AGILITY_ABL, 1 },
                { ATTR_ID.STRENGTH_ABL, 1 },
            };

            tb.AddAttributes(attList);
            tb.Rebuild();
            print(tb, "addlist");

            Console.WriteLine("removelistttttttttttttttttt");
            tb.RemoveAttributes(attList);
            tb.Rebuild();
            print(tb, "removelist");
        }
Exemple #3
0
        private void LoadGenerateConfig()
        {
            //载入基础配置
            LuaConfigs.LoadSingleConfig <TableGlobalConfig>("run_config\\global.lua");
            //载入excel属性配置
            LuaConfigs.LoadSingleConfig <ExcelConfig>(TableGlobalConfig.Instance.excelPropConfigPath);
            //载入excel属性配置
            LuaConfigs.LoadSingleConfig <TableGenerateConfig>(TableGlobalConfig.Instance.tableTemplDataPath + TableGlobalConfig.Instance.tableGenerateConfigName);

            //自定义表格配置数据
            foreach (var customTableName in TableGenerateConfig.Instance.tableList)
            {
                var customTable = LuaConfigs.LoadSingleConfig <ExcelDataConfig>(TableGlobalConfig.Instance.tableTemplDataPath + customTableName + ".lua");
                allExcelDataConfigs.Add(customTable);
            }
        }
Exemple #4
0
        public void Init()
        {
            //Console.Write(Directory.GetCurrentDirectory());
            //载入基础配置
            LuaConfigs.LoadSingleConfig <TableGlobalConfig>("run_config\\global.lua");
            //载入数据配置
            LuaConfigs.LoadSingleConfig <TableDataConfig>(TableGlobalConfig.Instance.dataConfigPath);
            //载入excel属性配置
            LuaConfigs.LoadSingleConfig <ExcelConfig>(TableGlobalConfig.Instance.excelPropConfigPath);

            //通用表格bean、enum配置
            var commonTable = LuaConfigs.LoadSingleConfig <TableConfig>(TableGlobalConfig.Instance.GetCommonConfigPath());

            AddCommonTableConfig(commonTable);
            //自定义表格配置
            foreach (var customTableName in TableGlobalConfig.Instance.customConfigs)
            {
                var customTable = LuaConfigs.LoadSingleConfig <TableConfig>(TableGlobalConfig.Instance.tableLuaDefinePath + customTableName + ".lua");
                AddTableConfig(customTable);
            }
        }