Exemplo n.º 1
0
        public OpenProfileDialog(LoadOrderProfile profile)
        {
            Profile = profile;
            InitializeComponent();
            dataGridView1.VirtualMode            = true;
            dataGridView1.CellValueNeeded       += DataGridView1_CellValueNeeded;
            dataGridView1.CellToolTipTextNeeded += DataGridView1_CellToolTipTextNeeded;
            dataGridView1.CellContentClick      += DataGridView1_CellContentClick;
            dataGridView1.VisibleChanged        += DataGridView1_VisibleChanged;
            dataGridView1.DataError             += DataGridView1_DataError;
            cbItemType.SetItems <ItemTypeT>();
            foreach (var item in cbItemType.CheckBoxItems)
            {
                item.Checked = true;
            }

            Populate();

            btnCancel.Click  += BtnCancel_Click;
            btnReplace.Click += BtnReplace_Click;
            btnAppend.Click  += BtnAppend_Click;
            btnReload.Click  += BtnReload_Click;

            btnAppend.SetTooltip("current mods/assets + profile mods/assets");
            btnReplace.SetTooltip("profile mods/assets only");
            cbItemType.AutoSize();
        }
Exemplo n.º 2
0
        public static void Start()
        {
            Log.Info("command line mode");
            if (Parse.LoadProfile(out string path))
            {
                if (!File.Exists(path))
                {
                    string path2 = Path.Combine(LoadOrderProfile.DIR, path);
                    if (!File.Exists(path2))
                    {
                        throw new Exception("could not find " + path);
                    }
                    path = path2;
                }
                Profile = LoadOrderProfile.Deserialize(path);
            }

            ManagerList.instance.Load();

            if (Profile != null)
            {
                Log.Info("loading profile ...");
                ManagerList.instance.LoadFromProfile(Profile, replace: true);
                Log.Info("saving profile ...");
                ConfigWrapper.instance.SaveConfig();
                Log.Info("Successful!");
            }
        }