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); Uri GetItemUri(int id);
bool ImportItemFrom(Uri uri); bool ImportItemFrom(Uri uri);
[Obsolete]
string[] GetSupportedFormats(); string[] GetSupportedFormats();
[Obsolete]
IReadOnlyDictionary<string, string> GetPresetPaths(); IReadOnlyDictionary<string, string> GetPresetPaths();
event Action ItemChanged; event Action ItemChanged;

View File

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