Пример #1
0
        public static bool FileSelectPatch(SelectWallpaperApp __instance)
        {
            var _this = __instance;

            if (_this.m_fileExplorer)
            {
                string path = _this.m_fileExplorer.m_selectedFile.GetFullPath();
                if (path.EndsWith("jpg") || path.EndsWith("png"))
                {
                    // 是图片,交给游戏处理
                    return(true);
                }
                _this.FreeTextureMemory();
                _this.m_customWallpaperPreview.sprite = _this.transform.parent.GetComponentInParent <OS>().m_defaultDesktop;
                if (!_this.m_customWallpaperPreview.gameObject.activeSelf)
                {
                    _this.m_customWallpaperPreview.gameObject.SetActive(true);
                }
                if (_this.m_currentFilePath)
                {
                    _this.m_currentFilePath.text = _this.m_fileExplorer.GetSelectedFileName();
                }
                _this.m_uploadToWorkshopButton.gameObject.SetActive(_this.IsSteamWorkshopActive);
            }
            return(false);
        }
Пример #2
0
 public static void FileFilterPatch(SelectWallpaperApp __instance)
 {
     __instance.m_fileExplorer.m_fileFilters = new string[] { "*jpg", "*png", "*mp4" };
 }