Пример #1
0
        public static ModDetail GetModDetail(PublishedFileDetail detail)
        {
            var result = new ModDetail();

            result.AppId       = detail.creator_app_id;
            result.ModId       = detail.publishedfileid;
            result.TimeUpdated = detail.time_updated;
            result.Title       = detail.title;
            result.IsValid     = true;
            return(result);
        }
        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();
        }