Beispiel #1
0
        private void deleteModButton_Click(object sender, EventArgs e)
        {
            SortedDictionary <int, Mod> mods = Profiles.currentProfile.mods;
            DataGridViewRow             row  = modsListDataGridView.SelectedRows[0];

            mods.Remove(Convert.ToInt32(row.Cells[0].Value));
            mods = Mods.SortKeys(mods);
            Profiles.currentProfile.mods = mods;
            ConfigUI.LoadProfileMods(Profiles.currentProfile.mods);
        }
Beispiel #2
0
        public static async Task MoveModUpDown(bool up)
        {
            int          upDown               = up ? 0 : -2;
            MainForm     MainForm_Control     = Application.OpenForms.OfType <MainForm>().First();
            DataGridView modsListDataGridView = (DataGridView)MainForm_Control.Controls.Find("modsListDataGridView", true).First();
            SortedDictionary <int, Mod> mods  = Profiles.currentProfile.mods;
            int pos = Convert.ToInt32(modsListDataGridView.SelectedRows[0].Cells[0].Value);

            mods = Mods.MoveMod(mods, pos, up);
            Profiles.currentProfile.mods = mods;
            ConfigUI.LoadProfileMods(Profiles.currentProfile.mods);
            modsListDataGridView.ClearSelection();
            modsListDataGridView.Rows[pos + upDown].Selected = true;
        }
        private void commitAddModButton_Click(object sender, EventArgs e)
        {
            List <string> temp = new List <string>();

            temp.Add(modSearchTermTextBox.Text);
            PublishedFileDetailsResponse wsFile = SteamWorkshop.GetSteamModDetails(temp);

            if (wsFile.publishedfiledetails == null)
            {
                MessageBox.Show("Mod was not found. Please try again.");
                return;
            }
            PublishedFileDetail wsDetail = wsFile.publishedfiledetails[0];
            Mod newMod = new Mod()
            {
                Name = wsDetail.title, Id = Convert.ToUInt32(modSearchTermTextBox.Text), LastUpdate = SteamWorkshop.FromUnixTime(wsDetail.time_updated)
            };

            Profiles.currentProfile.mods[Profiles.currentProfile.mods.Count + 1] = newMod;
            Profiles.currentProfile.save();
            ConfigUI.LoadProfileMods(Profiles.currentProfile.mods);
            Close();
        }
Beispiel #4
0
 private void decreaseModIndexButton_Click(object sender, EventArgs e)
 {
     ConfigUI.MoveModUpDown(false);
 }
Beispiel #5
0
 private void increadeModIndexButton_Click(object sender, EventArgs e)
 {
     ConfigUI.MoveModUpDown(true);
 }