From eb7b595c513d55f1c19d3b4cb670a635a6a65b01 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Wed, 11 Oct 2023 22:43:12 +0900 Subject: [PATCH 1/3] chore(migration): ignore instead of just close window --- Editor/Migration/PrereleaseStateDetector.cs | 23 +++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/Editor/Migration/PrereleaseStateDetector.cs b/Editor/Migration/PrereleaseStateDetector.cs index c7a74bd5d..c1115d294 100644 --- a/Editor/Migration/PrereleaseStateDetector.cs +++ b/Editor/Migration/PrereleaseStateDetector.cs @@ -42,7 +42,8 @@ private static void ShowMigrationRequiredWarning() while (true) { - string title, message, ok, cancel, alt; + string title, message, ok, ignore, alt; + string checkAgain, back; if (isJapanese) { title = "MIGRATION REQUIRED"; @@ -57,7 +58,9 @@ private static void ShowMigrationRequiredWarning() "3. Unityを起動し、v0.4.xへのマイグレーションを実行する\n" + "4. AvatarOptimizerを再度アップグレードする"; ok = "保存せずにUnityを閉じる"; - cancel = "閉じる"; + ignore = "無視する"; + checkAgain = "AvatarOptimizerの設定が失われますが本当に無視しますか?"; + back = "警告に戻る"; alt = "Read in English"; } else @@ -74,17 +77,25 @@ private static void ShowMigrationRequiredWarning() "3. Open Unity and run migration\n" + "4. Upgrade AvatarOptimizer again."; ok = "Exit Unity without saving anything"; - cancel = "Close"; + ignore = "Ignore"; + checkAgain = "Do you REALLY want to ignore this warning?" + + "You'll lost the configurations of AvatarOptimizer"; + back = "Back to Warning"; alt = "日本語で読む"; } - switch (EditorUtility.DisplayDialogComplex(title, message, ok, cancel, alt)) + switch (EditorUtility.DisplayDialogComplex(title, message, ok, ignore, alt)) { case 0: // OK: Exit EditorApplication.Exit(0); return; - case 1: // Cancel: Close - return; + case 1: // Cancel: Ignore + if (EditorUtility.DisplayDialog(title, checkAgain, ignore, back)) + { + File.Delete(DataPath); + return; + } + break; case 2: // Show in another language isJapanese = !isJapanese; break; From 99dac5af947adef79db7b1e0165ac80b4e86ebf4 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Wed, 11 Oct 2023 22:46:28 +0900 Subject: [PATCH 2/3] docs(changelog): Ignore the warning instead of migration from 0.3.x or older --- CHANGELOG-PRERELEASE.md | 1 + CHANGELOG.md | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG-PRERELEASE.md b/CHANGELOG-PRERELEASE.md index 38d78e592..cb5f480d2 100644 --- a/CHANGELOG-PRERELEASE.md +++ b/CHANGELOG-PRERELEASE.md @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog]. ### Added ### Changed +- Ignore the warning instead of migration from 0.3.x or older `#570` ### Deprecated diff --git a/CHANGELOG.md b/CHANGELOG.md index 796b698f2..d3d7b5004 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog]. ### Added ### Changed +- Ignore the warning instead of migration from 0.3.x or older `#570` ### Deprecated From 62220f257c2741c964a0dae5200e43a5e1d6ddde Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Wed, 11 Oct 2023 23:48:34 +0900 Subject: [PATCH 3/3] chore: Apply suggestions from code review Co-authored-by: Sayamame-beans <61457993+Sayamame-beans@users.noreply.github.com> --- Editor/Migration/PrereleaseStateDetector.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Editor/Migration/PrereleaseStateDetector.cs b/Editor/Migration/PrereleaseStateDetector.cs index c1115d294..d19827753 100644 --- a/Editor/Migration/PrereleaseStateDetector.cs +++ b/Editor/Migration/PrereleaseStateDetector.cs @@ -59,8 +59,9 @@ private static void ShowMigrationRequiredWarning() "4. AvatarOptimizerを再度アップグレードする"; ok = "保存せずにUnityを閉じる"; ignore = "無視する"; - checkAgain = "AvatarOptimizerの設定が失われますが本当に無視しますか?"; - back = "警告に戻る"; + checkAgain = "AvatarOptimizerの設定が失われる可能性があります。\n" + + "本当によろしいですか?"; + back = "警告を読み直す"; alt = "Read in English"; } else @@ -78,7 +79,7 @@ private static void ShowMigrationRequiredWarning() "4. Upgrade AvatarOptimizer again."; ok = "Exit Unity without saving anything"; ignore = "Ignore"; - checkAgain = "Do you REALLY want to ignore this warning?" + + checkAgain = "Do you REALLY want to ignore this warning?\n" + "You'll lost the configurations of AvatarOptimizer"; back = "Back to Warning"; alt = "日本語で読む";