Obsolete the old file dialog.

This commit is contained in:
2023-11-13 00:27:20 +08:00
parent 8c11be48cf
commit 0cdd6e569e
2 changed files with 6 additions and 0 deletions

View File

@@ -6,7 +6,9 @@ namespace Cryville.Crtr.Browsing {
Uri GetItemUri(int id);
bool ImportItemFrom(Uri uri);
[Obsolete]
string[] GetSupportedFormats();
[Obsolete]
IReadOnlyDictionary<string, string> GetPresetPaths();
event Action ItemChanged;

View File

@@ -13,6 +13,7 @@ namespace Cryville.Crtr.Browsing.UI {
readonly HashSet<int> _selectedItems = new HashSet<int>();
readonly Dictionary<int, BrowserItem> _items = new Dictionary<int, BrowserItem>();
[Obsolete]
FileDialog _dialog;
protected virtual void Start() {
@@ -22,6 +23,7 @@ namespace Cryville.Crtr.Browsing.UI {
InitDialog();
}
[Obsolete]
protected void InitDialog() {
_dialog = Instantiate(Resources.Load<GameObject>("Common/FileDialog")).GetComponent<FileDialog>();
_dialog.gameObject.SetActive(false);
@@ -65,10 +67,12 @@ namespace Cryville.Crtr.Browsing.UI {
ResourceManager.ReturnToDirectory(id);
}
[Obsolete]
public void OnAddButtonClicked() {
_dialog.Show();
}
[Obsolete]
private void OnAddDialogClosed() {
if (_dialog.FileName == null) return;
if (ResourceManager.ImportItemFrom(new Uri(_dialog.FileName))) {