Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(migration): ignore instead of just close window #570

Merged
merged 3 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG-PRERELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
24 changes: 18 additions & 6 deletions Editor/Migration/PrereleaseStateDetector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -57,7 +58,10 @@ private static void ShowMigrationRequiredWarning()
"3. Unityを起動し、v0.4.xへのマイグレーションを実行する\n" +
"4. AvatarOptimizerを再度アップグレードする";
ok = "保存せずにUnityを閉じる";
cancel = "閉じる";
ignore = "無視する";
checkAgain = "AvatarOptimizerの設定が失われる可能性があります。\n" +
"本当によろしいですか?";
back = "警告を読み直す";
alt = "Read in English";
}
else
Expand All @@ -74,17 +78,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?\n" +
"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;
Expand Down
Loading