Пример #1
0
        public WorkshopItemUpdate(WorkshopItem p_existingItem)
        {
            if (p_existingItem.SteamNative != null)
            {
                // this is an existing item -> copy data
                Name        = p_existingItem.Name;
                Description = p_existingItem.Description;
                ContentPath = p_existingItem.InstalledLocalFolder;
                SteamNative = new SteamNativeData(p_existingItem.SteamNative.m_nPublishedFileId);
                ChangeNote  = "";
                Tags        = new List <string>();

                // try to find icon
                if (!string.IsNullOrEmpty(ContentPath))
                {
                    string possibleIconPath = System.IO.Path.Combine(ContentPath, Name + ".png");
                    if (System.IO.File.Exists(possibleIconPath))
                    {
                        IconPath = possibleIconPath;
                    }
                }
            }
            else
            {
                // this is a new item
                SteamNative = new SteamNativeData();
                ChangeNote  = "Initial version";
                Tags        = new List <string>();
            }
        }
Пример #2
0
    public void SetOpenSaveOrWorkshop(bool on)
    {
        if (!on)
        {
#if USE_STEAMWORKS
            workshopInfo.Close();
#endif
            saveMenu.SetOpen(false);
            return;
        }

        if (!ShowWorkshopInfo())
        {
            saveMenu.SetOpen(true);
        }
        else
        {
#if USE_STEAMWORKS
            SteamUtil.GetWorkShopItem(GetWorkshopFileID(), maybeItem =>
            {
                if (!maybeItem.IsEmpty())
                {
                    LapinerTools.Steam.Data.WorkshopItem item = maybeItem.Value;
                    workshopInfo.Open(maybeItem.Value);
                }
            });
#endif
        }
    }
Пример #3
0
 public WorkshopItemEventArgs(WorkshopItem p_item) : base()
 {
     Item = p_item;
 }