diff --git a/Qwilight/Assets/Language.json b/Qwilight/Assets/Language.json
index 2da5b10..d68c99f 100644
--- a/Qwilight/Assets/Language.json
+++ b/Qwilight/Assets/Language.json
@@ -851,6 +851,10 @@
"ko-KR": "롱 노트 모드를 적용하지 않습니다.",
"en-US": "Does not apply long note mode."
},
+ "DefaultNotify": {
+ "ko-KR": "메시지 알림 ({0} 개)",
+ "en-US": "Message notifications ({0})"
+ },
"DefaultPutCopyNotesText": {
"ko-KR": "노트 복사하지 않기",
"en-US": "Don't copy notes"
@@ -1299,6 +1303,10 @@
"ko-KR": "#,##0 개 출력",
"en-US": "#,##0 output"
},
+ "HandlingNotify": {
+ "ko-KR": "작업 알림 ({0} 개)",
+ "en-US": "Job notifications ({0})"
+ },
"HasNotEventNoteNoteFile": {
"ko-KR": "노트 파일을 먼저 불러오세요",
"en-US": "Load the chart file first."
@@ -2768,6 +2776,10 @@
"en-US": "Skip it"
},
"PassNotify": {
+ "ko-KR": "기록 추월 알림 ({0} 개)",
+ "en-US": "Record overtaking notifications ({0})"
+ },
+ "PassNotifyText": {
"ko-KR": "{0}의 기록을 {1}님이 추월함",
"en-US": "{1} has overtaken the record of {0}"
},
@@ -3579,6 +3591,10 @@
"ko-KR": "뒤로 가기 ({0})",
"en-US": "Go Back ({0})"
},
+ "WaitingDefaultNotifyContents": {
+ "ko-KR": "F11 키로 도착한 {0} 개의 메시지 알림을 확인하세요",
+ "en-US": "Press F11 to see the {0} message notifications that have arrived"
+ },
"WaitingIOContents": {
"ko-KR": "관전 동기화 중…",
"en-US": "Synchronizing observations…"
@@ -3587,9 +3603,9 @@
"ko-KR": "다른 플레이어를 기다리는 중…",
"en-US": "Waiting for another player…"
},
- "WaitingNotifyContents": {
- "ko-KR": "F11 키로 도착한 {0}개의 알림을 확인하세요",
- "en-US": "Check {0} alerts that arrived with F11 keys."
+ "WaitingPassNotifyContents": {
+ "ko-KR": "F11 키로 도착한 {0} 개의 기록 추월 알림을 확인하세요",
+ "en-US": "Press F11 to see the {0} record overtake notifications that have arrived"
},
"WaitSiteContents": {
"ko-KR": "대화방에 자동으로 입장하지 않습니다.",
diff --git a/Qwilight/JSON.cs b/Qwilight/JSON.cs
index 2e544f5..72a90b6 100644
--- a/Qwilight/JSON.cs
+++ b/Qwilight/JSON.cs
@@ -255,6 +255,7 @@
public string artist;
public string genre;
public string levelText;
+ public string avatarID;
public string avatarName;
public string noteID;
}
diff --git a/Qwilight/Qwilight.csproj b/Qwilight/Qwilight.csproj
index 784ae90..5bc3809 100644
--- a/Qwilight/Qwilight.csproj
+++ b/Qwilight/Qwilight.csproj
@@ -10,7 +10,7 @@
Qwilight.ico
Taehui
불로그
- 1.16.38
+ 1.16.39
true
enable
false
diff --git a/Qwilight/System/LanguageSystem/LanguageSystem.g.cs b/Qwilight/System/LanguageSystem/LanguageSystem.g.cs
index f5849fc..b3f005e 100644
--- a/Qwilight/System/LanguageSystem/LanguageSystem.g.cs
+++ b/Qwilight/System/LanguageSystem/LanguageSystem.g.cs
@@ -215,6 +215,7 @@
public string DefaultModeContents { get; set; }
public string DefaultNoteAssister { get; set; }
public string DefaultNoteModifyContents { get; set; }
+ public string DefaultNotify { get; set; }
public string DefaultPutCopyNotesText { get; set; }
public string DefaultSaltModeContents { get; set; }
public string DefaultSetNoteModeContents { get; set; }
@@ -327,6 +328,7 @@
public string HandleUndoContents { get; set; }
public string HandlingAudioCountText { get; set; }
public string HandlingCountContents { get; set; }
+ public string HandlingNotify { get; set; }
public string HasNotEventNoteNoteFile { get; set; }
public string HasNotIONoteFile { get; set; }
public string HasNotNetNoteFile { get; set; }
@@ -695,6 +697,7 @@
public string P2SymmetricCopyNotesText { get; set; }
public string PassContents { get; set; }
public string PassNotify { get; set; }
+ public string PassNotifyText { get; set; }
public string PauseAssist { get; set; }
public string PlatformAutoComputing { get; set; }
public string PlatformCommentComputing { get; set; }
@@ -897,9 +900,10 @@
public string VoidPutSetNoteModeContents { get; set; }
public string VoteText { get; set; }
public string WaitContents { get; set; }
+ public string WaitingDefaultNotifyContents { get; set; }
public string WaitingIOContents { get; set; }
public string WaitingNetContents { get; set; }
- public string WaitingNotifyContents { get; set; }
+ public string WaitingPassNotifyContents { get; set; }
public string WaitSiteContents { get; set; }
public string WaitUnitContents { get; set; }
public string WantAverageInputCountContents { get; set; }
diff --git a/Qwilight/System/LevelSystem.cs b/Qwilight/System/LevelSystem.cs
index befd144..ade7f31 100644
--- a/Qwilight/System/LevelSystem.cs
+++ b/Qwilight/System/LevelSystem.cs
@@ -138,14 +138,14 @@
if (levelTable.HasValue)
{
var levelTableValue = levelTable.Value;
- var savingLevelItem = new NotifyItem
+ var levelNotifyItem = new NotifyItem
{
Text = LanguageSystem.Instance.SavingLevelContents,
- Variety = NotifySystem.NotifyVariety.Levying,
+ Variety = NotifySystem.NotifyVariety.Handling,
OnStop = wipeTotal => false
};
- UIHandler.Instance.HandleParallel(() => ViewModels.Instance.NotifyValue.NotifyItemCollection.Insert(0, savingLevelItem));
- NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Info, NotifySystem.NotifyConfigure.NotSave, savingLevelItem.Text, false, null, null, NotifySystem.SaveLevelID);
+ UIHandler.Instance.HandleParallel(() => ViewModels.Instance.NotifyValue.HandlingNotifyItemCollection.Insert(0, levelNotifyItem));
+ NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Info, NotifySystem.NotifyConfigure.NotSave, levelNotifyItem.Text, false, null, null, NotifySystem.SaveLevelID);
var target = ModifyDataValue(levelTableValue.data_url, www);
var levelTableFileName = levelTableValue.name;
foreach (var targetFileName in Path.GetInvalidFileNameChars())
@@ -157,7 +157,7 @@
wwwClient.DefaultRequestHeaders.Add("User-Agent", "Mozilla/5.0");
using (var hrm = await wwwClient.GetAsync(target, HttpCompletionOption.ResponseHeadersRead).ConfigureAwait(false))
{
- savingLevelItem.MaxStatus = hrm.Content.Headers.ContentLength ?? 0L;
+ levelNotifyItem.MaxStatus = hrm.Content.Headers.ContentLength ?? 0L;
}
using (var fs = File.Open(Path.Combine(EntryPath, $"{levelTableFileName}.json"), FileMode.Create))
using (var ws = await wwwClient.GetStreamAsync(target).ConfigureAwait(false))
@@ -166,7 +166,7 @@
while ((length = await ws.ReadAsync(data.AsMemory(0, data.Length)).ConfigureAwait(false)) > 0)
{
await fs.WriteAsync(data.AsMemory(0, length));
- savingLevelItem.Status += length;
+ levelNotifyItem.Status += length;
}
}
}
@@ -175,9 +175,9 @@
s.Position = 0;
await s.CopyToAsync(fs);
}
- savingLevelItem.Variety = NotifySystem.NotifyVariety.Quit;
- savingLevelItem.Text = LanguageSystem.Instance.SavedLevelContents;
- savingLevelItem.OnStop = wipeTotal => true;
+ levelNotifyItem.Variety = NotifySystem.NotifyVariety.Stopped;
+ levelNotifyItem.Text = LanguageSystem.Instance.SavedLevelContents;
+ levelNotifyItem.OnStop = wipeTotal => true;
NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Info, NotifySystem.NotifyConfigure.NotSave, LanguageSystem.Instance.SavedLevelContents, false, null, null, NotifySystem.SaveLevelID);
Configure.Instance.LevelTargetMap[levelTableFileName] = www;
LoadLevelFiles();
diff --git a/Qwilight/System/NotifySystem.cs b/Qwilight/System/NotifySystem.cs
index 4851820..feffbfe 100644
--- a/Qwilight/System/NotifySystem.cs
+++ b/Qwilight/System/NotifySystem.cs
@@ -17,7 +17,7 @@
public enum NotifyVariety
{
- OK, Fault, Warning, Info, Levying, Stopped, Quit
+ OK, Fault, Warning, Info, Handling, Cancelled, Stopped
}
public enum NotifyConfigure
@@ -27,19 +27,41 @@
public static readonly NotifySystem Instance = new();
- int _toNotifyID;
+ int _defaultNotifyID;
- public void NotifyPending() => UIHandler.Instance.HandleParallel(() =>
+ public void NotifyPendingDefaultNotify() => UIHandler.Instance.HandleParallel(() =>
{
- var toNotifyCount = ViewModels.Instance.NotifyValue.NotifyItemCollection.Count(toNotifyItem =>
+ var defaultNotifyCount = ViewModels.Instance.NotifyValue.DefaultNotifyItemCollection.Count(defaultNotifyItem =>
{
- var isNew = toNotifyItem.IsNew;
- toNotifyItem.IsNew = false;
- return isNew;
+ var isNew = defaultNotifyItem.IsNew;
+ defaultNotifyItem.IsNew = false;
+ return defaultNotifyItem.IsNew;
});
- if (toNotifyCount > 0)
+ if (defaultNotifyCount > 0)
{
- Notify(NotifyVariety.Info, NotifyConfigure.NotSave, string.Format(LanguageSystem.Instance.WaitingNotifyContents, toNotifyCount));
+ Notify(NotifyVariety.Info, NotifyConfigure.NotSave, string.Format(LanguageSystem.Instance.WaitingDefaultNotifyContents, defaultNotifyCount), false, null, () =>
+ {
+ ViewModels.Instance.NotifyValue.TabPosition = 0;
+ ViewModels.Instance.NotifyValue.Open();
+ });
+ }
+ });
+
+ public void NotifyPendingPassNotify() => UIHandler.Instance.HandleParallel(() =>
+ {
+ var passNotifyCount = ViewModels.Instance.NotifyValue.PassNotifyItemCollection.Count(passNotifyItem =>
+ {
+ var isNew = passNotifyItem.IsNew;
+ passNotifyItem.IsNew = false;
+ return passNotifyItem.IsNew;
+ });
+ if (passNotifyCount > 0)
+ {
+ Notify(NotifyVariety.Info, NotifyConfigure.NotSave, string.Format(LanguageSystem.Instance.WaitingPassNotifyContents, passNotifyCount), false, null, () =>
+ {
+ ViewModels.Instance.NotifyValue.TabPosition = 2;
+ ViewModels.Instance.NotifyValue.Open();
+ });
}
});
@@ -104,7 +126,7 @@
},
Contents = toNotify,
OnHandle = onHandle,
- ID = toNotifyID ?? ++_toNotifyID
+ ID = toNotifyID ?? ++_defaultNotifyID
});
return true;
}
@@ -113,12 +135,7 @@
void Save(NotifyVariety toNotifyVariety, string toNotify, bool isNew)
{
- var toNotifyCollection = ViewModels.Instance.NotifyValue.NotifyItemCollection;
- if (toNotifyCollection.Count == 100)
- {
- toNotifyCollection.RemoveAt(99);
- }
- toNotifyCollection.Insert(0, new()
+ ViewModels.Instance.NotifyValue.DefaultNotifyItemCollection.Insert(0, new()
{
Variety = toNotifyVariety,
Text = toNotify,
diff --git a/Qwilight/System/TelnetSystem/DefaultTelnetSystem.cs b/Qwilight/System/TelnetSystem/DefaultTelnetSystem.cs
index dc8b8c8..2df3199 100644
--- a/Qwilight/System/TelnetSystem/DefaultTelnetSystem.cs
+++ b/Qwilight/System/TelnetSystem/DefaultTelnetSystem.cs
@@ -3,6 +3,7 @@
using Qwilight.Compute;
using Qwilight.MSG;
using Qwilight.NoteFile;
+using Qwilight.UIComponent;
using Qwilight.Utilities;
using Qwilight.ViewModel;
using System.Collections.Concurrent;
@@ -106,20 +107,63 @@
break;
case ConsoleKey.N:
Console.Clear();
- Console.WriteLine("1, 2, 3, 4");
+ Console.WriteLine("1, 2, 3, 4, 5, 6, 7, 8");
switch (Console.ReadKey(true).Key)
{
case ConsoleKey.D1:
- NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.OK, NotifySystem.NotifyConfigure.Default, Guid.NewGuid().ToString());
+ NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.OK, NotifySystem.NotifyConfigure.Default, Guid.NewGuid().ToString(), true);
break;
case ConsoleKey.D2:
- NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Fault, NotifySystem.NotifyConfigure.Default, Guid.NewGuid().ToString());
+ NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Fault, NotifySystem.NotifyConfigure.Default, Guid.NewGuid().ToString(), true);
break;
case ConsoleKey.D3:
- NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Warning, NotifySystem.NotifyConfigure.Default, Guid.NewGuid().ToString());
+ NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Warning, NotifySystem.NotifyConfigure.Default, Guid.NewGuid().ToString(), true);
break;
case ConsoleKey.D4:
- NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Info, NotifySystem.NotifyConfigure.Default, Guid.NewGuid().ToString());
+ NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Info, NotifySystem.NotifyConfigure.Default, Guid.NewGuid().ToString(), true);
+ break;
+ case ConsoleKey.D5:
+ var valueNotifyItem = new NotifyItem
+ {
+ Text = Guid.NewGuid().ToString(),
+ Variety = NotifySystem.NotifyVariety.Handling
+ };
+ UIHandler.Instance.HandleParallel(() => ViewModels.Instance.NotifyValue.HandlingNotifyItemCollection.Insert(0, valueNotifyItem));
+ NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Info, NotifySystem.NotifyConfigure.NotSave, valueNotifyItem.Text, true);
+ break;
+ case ConsoleKey.D6:
+ valueNotifyItem = new NotifyItem
+ {
+ Text = Guid.NewGuid().ToString(),
+ Variety = NotifySystem.NotifyVariety.Cancelled
+ };
+ UIHandler.Instance.HandleParallel(() => ViewModels.Instance.NotifyValue.HandlingNotifyItemCollection.Insert(0, valueNotifyItem));
+ NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Info, NotifySystem.NotifyConfigure.NotSave, valueNotifyItem.Text, true);
+ break;
+ case ConsoleKey.D7:
+ valueNotifyItem = new NotifyItem
+ {
+ Text = Guid.NewGuid().ToString(),
+ Variety = NotifySystem.NotifyVariety.Stopped
+ };
+ UIHandler.Instance.HandleParallel(() => ViewModels.Instance.NotifyValue.HandlingNotifyItemCollection.Insert(0, valueNotifyItem));
+ NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Info, NotifySystem.NotifyConfigure.NotSave, valueNotifyItem.Text, true);
+ break;
+ case ConsoleKey.D8:
+ var mainViewModel = ViewModels.Instance.MainValue;
+ var noteFile = mainViewModel.EntryItemValue?.NoteFile;
+ if (noteFile != null)
+ {
+ var passNotifyItem = new NotifyItem
+ {
+ Text = string.Format(LanguageSystem.Instance.PassNotifyText, noteFile.PlatformText, TwilightSystem.Instance.AvatarName),
+ Variety = NotifySystem.NotifyVariety.Info,
+ OnHandle = async () => await mainViewModel.MoveEntryItemsView(noteFile.GetNoteID512()),
+ AvatarWwwValue = new(TwilightSystem.Instance.AvatarID)
+ };
+ UIHandler.Instance.HandleParallel(() => ViewModels.Instance.NotifyValue.PassNotifyItemCollection.Insert(0, passNotifyItem));
+ NotifySystem.Instance.Notify(passNotifyItem.Variety, NotifySystem.NotifyConfigure.NotSave, passNotifyItem.Text, true, "Notify Pass");
+ }
break;
}
break;
diff --git a/Qwilight/System/TwilightSystem.cs b/Qwilight/System/TwilightSystem.cs
index c68fa19..f817c54 100644
--- a/Qwilight/System/TwilightSystem.cs
+++ b/Qwilight/System/TwilightSystem.cs
@@ -329,8 +329,30 @@
NotifySystem.Instance.Notify(twilightNotify.v, NotifySystem.NotifyConfigure.Default, twilightNotify.text, twilightNotify.isUrgent);
break;
case Event.Types.EventID.NotifyPass:
- var twilightNotifyPass = Utility.GetJSON(eventItemText);
- NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Info, NotifySystem.NotifyConfigure.Default, string.Format(LanguageSystem.Instance.PassNotify, Utility.GetPlatformText(twilightNotifyPass.title, twilightNotifyPass.artist, Utility.GetGenreText(twilightNotifyPass.genre), twilightNotifyPass.levelText), twilightNotifyPass.avatarName), false, "Notify Pass", async () => await mainViewModel.MoveEntryItemsView(twilightNotifyPass.noteID));
+ var twilightNotifyPasses = Utility.GetJSON(eventItemText);
+ var passNotifyItems = twilightNotifyPasses.Select(twilightNotifyPass => new NotifyItem
+ {
+ Text = string.Format(LanguageSystem.Instance.PassNotifyText, Utility.GetPlatformText(twilightNotifyPass.title, twilightNotifyPass.artist, Utility.GetGenreText(twilightNotifyPass.genre), twilightNotifyPass.levelText), twilightNotifyPass.avatarName),
+ Variety = NotifySystem.NotifyVariety.Info,
+ OnHandle = async () => await mainViewModel.MoveEntryItemsView(twilightNotifyPass.noteID),
+ AvatarWwwValue = new(twilightNotifyPass.avatarID)
+ }).ToArray();
+ UIHandler.Instance.HandleParallel(() =>
+ {
+ foreach (var passNotifyItem in passNotifyItems)
+ {
+ ViewModels.Instance.NotifyValue.PassNotifyItemCollection.Insert(0, passNotifyItem);
+ }
+ });
+ if (passNotifyItems.Length > 1)
+ {
+ NotifySystem.Instance.NotifyPendingPassNotify();
+ }
+ else
+ {
+ var passNotifyItem = passNotifyItems.Single();
+ NotifySystem.Instance.Notify(passNotifyItem.Variety, NotifySystem.NotifyConfigure.NotSave, passNotifyItem.Text, false, "Notify Pass");
+ }
break;
case Event.Types.EventID.LevelUp:
var twilightLevelUp = Utility.GetJSON(eventItemText);
@@ -725,10 +747,10 @@
var bundleEntryPath = twilightSaveAsBundle.bundleEntryPath;
var saveAsBundleID = twilightSaveAsBundle.bundleID;
var saveAsBundleVariety = (BundleItem.BundleVariety)twilightSaveAsBundle.bundleVariety;
- var savingBundleItem = new NotifyItem
+ var bundleNotifyItem = new NotifyItem
{
Text = LanguageSystem.Instance.SaveAsBundleContents,
- Variety = NotifySystem.NotifyVariety.Levying,
+ Variety = NotifySystem.NotifyVariety.Handling,
Data = ArrayPool.Shared.Rent(QwilightComponent.SendUnit),
OnStop = wipeTotal =>
{
@@ -740,7 +762,7 @@
{
if (_savingBundleItems.Remove(saveAsBundleID, out var savingBundleItem))
{
- savingBundleItem.Variety = NotifySystem.NotifyVariety.Stopped;
+ savingBundleItem.Variety = NotifySystem.NotifyVariety.Cancelled;
savingBundleItem.Text = LanguageSystem.Instance.StopSavingAsBundleContents;
savingBundleItem.IsStopped = true;
SendParallel(Event.Types.EventID.StopSavingAsBundle, saveAsBundleID);
@@ -753,9 +775,9 @@
}
}
};
- _savingBundleItems[saveAsBundleID] = savingBundleItem;
- UIHandler.Instance.HandleParallel(() => toNotifyViewModel.NotifyItemCollection.Insert(0, savingBundleItem));
- NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Info, NotifySystem.NotifyConfigure.NotSave, savingBundleItem.Text, false, null, null, NotifySystem.SaveAsBundleID);
+ _savingBundleItems[saveAsBundleID] = bundleNotifyItem;
+ UIHandler.Instance.HandleParallel(() => toNotifyViewModel.HandlingNotifyItemCollection.Insert(0, bundleNotifyItem));
+ NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Info, NotifySystem.NotifyConfigure.NotSave, bundleNotifyItem.Text, false, null, null, NotifySystem.SaveAsBundleID);
Task.Run(() =>
{
try
@@ -840,11 +862,11 @@
}
}
- if (!savingBundleItem.IsStopped)
+ if (!bundleNotifyItem.IsStopped)
{
- savingBundleItem.Text = LanguageSystem.Instance.SavingAsBundleContents;
- NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Info, NotifySystem.NotifyConfigure.NotSave, savingBundleItem.Text, false, null, null, NotifySystem.SaveAsBundleID);
- savingBundleItem.MaxStatus = rms.Length;
+ bundleNotifyItem.Text = LanguageSystem.Instance.SavingAsBundleContents;
+ NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Info, NotifySystem.NotifyConfigure.NotSave, bundleNotifyItem.Text, false, null, null, NotifySystem.SaveAsBundleID);
+ bundleNotifyItem.MaxStatus = rms.Length;
rms.Position = 0;
while (_savingBundleItems.TryGetValue(saveAsBundleID, out var savingBundleItem))
{
@@ -856,7 +878,7 @@
Send(Event.Types.EventID.SavedAsBundle, saveAsBundleID, UnsafeByteOperations.UnsafeWrap(savingBundleItem.Data.AsMemory(0, length)));
if (_savingBundleItems.Remove(saveAsBundleID, out _))
{
- savingBundleItem.Variety = NotifySystem.NotifyVariety.Quit;
+ savingBundleItem.Variety = NotifySystem.NotifyVariety.Stopped;
savingBundleItem.Text = LanguageSystem.Instance.SavedAsBundleContents;
NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.OK, NotifySystem.NotifyConfigure.NotSave, savingBundleItem.Text, false, null, null, NotifySystem.SaveAsBundleID);
}
@@ -871,37 +893,37 @@
void OnSavingZipFile(object sender, SaveProgressEventArgs e)
{
- if (savingBundleItem.IsStopped)
+ if (bundleNotifyItem.IsStopped)
{
e.Cancel = true;
- savingBundleItem.Dispose();
+ bundleNotifyItem.Dispose();
}
else
{
if (e.EntriesTotal > 0)
{
- savingBundleItem.Status = e.EntriesSaved;
- savingBundleItem.MaxStatus = e.EntriesTotal;
+ bundleNotifyItem.Status = e.EntriesSaved;
+ bundleNotifyItem.MaxStatus = e.EntriesTotal;
}
}
}
}
catch (Exception e)
{
- savingBundleItem.OnStop(false);
+ bundleNotifyItem.OnStop(false);
NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Fault, NotifySystem.NotifyConfigure.Default, string.Format(LanguageSystem.Instance.SaveAsBundleFault, e.Message), false, null, null, NotifySystem.SaveAsBundleID);
}
finally
{
- savingBundleItem.Dispose();
+ bundleNotifyItem.Dispose();
}
});
break;
case Event.Types.EventID.StopSavingAsBundle:
- if (_savingBundleItems.TryGetValue(eventItemText, out savingBundleItem))
+ if (_savingBundleItems.TryGetValue(eventItemText, out bundleNotifyItem))
{
- savingBundleItem.Variety = NotifySystem.NotifyVariety.Stopped;
- savingBundleItem.Text = LanguageSystem.Instance.StopSavingAsBundleContents;
+ bundleNotifyItem.Variety = NotifySystem.NotifyVariety.Cancelled;
+ bundleNotifyItem.Text = LanguageSystem.Instance.StopSavingAsBundleContents;
}
break;
case Event.Types.EventID.SaveBundle:
@@ -909,10 +931,10 @@
var saveBundleID = twilightSaveBundle.bundleID;
var saveBundleVariety = (BundleItem.BundleVariety)twilightSaveBundle.bundleVariety;
var bundleLength = twilightSaveBundle.bundleLength;
- savingBundleItem = new NotifyItem
+ bundleNotifyItem = new NotifyItem
{
Text = LanguageSystem.Instance.SaveBundleContents,
- Variety = NotifySystem.NotifyVariety.Levying,
+ Variety = NotifySystem.NotifyVariety.Handling,
DataFlow = PoolSystem.Instance.GetDataFlow(bundleLength),
OnStop = wipeTotal =>
{
@@ -924,7 +946,7 @@
{
if (_savingBundleItems.Remove(saveBundleID, out var savingBundleItem))
{
- savingBundleItem.Variety = NotifySystem.NotifyVariety.Stopped;
+ savingBundleItem.Variety = NotifySystem.NotifyVariety.Cancelled;
savingBundleItem.Text = LanguageSystem.Instance.StopSavingBundleContents;
savingBundleItem.IsStopped = true;
SendParallel(Event.Types.EventID.StopSavingBundle, saveBundleID);
@@ -938,42 +960,42 @@
},
MaxStatus = bundleLength
};
- _savingBundleItems[saveBundleID] = savingBundleItem;
- UIHandler.Instance.HandleParallel(() => toNotifyViewModel.NotifyItemCollection.Insert(0, savingBundleItem));
+ _savingBundleItems[saveBundleID] = bundleNotifyItem;
+ UIHandler.Instance.HandleParallel(() => toNotifyViewModel.HandlingNotifyItemCollection.Insert(0, bundleNotifyItem));
if (saveBundleVariety != BundleItem.BundleVariety.DefaultNoteFiles && saveBundleVariety != BundleItem.BundleVariety.DefaultUI)
{
- NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Info, NotifySystem.NotifyConfigure.NotSave, savingBundleItem.Text, false, null, null, NotifySystem.SaveBundleID);
+ NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Info, NotifySystem.NotifyConfigure.NotSave, bundleNotifyItem.Text, false, null, null, NotifySystem.SaveBundleID);
}
SendParallel(Event.Types.EventID.SavingBundle, saveBundleID);
break;
case Event.Types.EventID.SavingBundle:
- if (_savingBundleItems.TryGetValue(eventItemText, out savingBundleItem))
+ if (_savingBundleItems.TryGetValue(eventItemText, out bundleNotifyItem))
{
- if (savingBundleItem.IsStopped)
+ if (bundleNotifyItem.IsStopped)
{
- savingBundleItem.Dispose();
+ bundleNotifyItem.Dispose();
}
else
{
- eventItemData[0].WriteTo(savingBundleItem.DataFlow);
+ eventItemData[0].WriteTo(bundleNotifyItem.DataFlow);
}
- savingBundleItem.Status += eventItemData[0].Length;
+ bundleNotifyItem.Status += eventItemData[0].Length;
}
break;
case Event.Types.EventID.SavedBundle:
var twilightSavedBundle = Utility.GetJSON(eventItemText);
- if (_savingBundleItems.Remove(twilightSavedBundle.bundleID, out savingBundleItem))
+ if (_savingBundleItems.Remove(twilightSavedBundle.bundleID, out bundleNotifyItem))
{
- if (savingBundleItem.IsStopped)
+ if (bundleNotifyItem.IsStopped)
{
- savingBundleItem.Dispose();
+ bundleNotifyItem.Dispose();
}
else
{
- eventItemData[0].WriteTo(savingBundleItem.DataFlow);
+ eventItemData[0].WriteTo(bundleNotifyItem.DataFlow);
Utility.HandleParallelly(() =>
{
- var dataFlow = savingBundleItem.DataFlow;
+ var dataFlow = bundleNotifyItem.DataFlow;
dataFlow.Position = 0;
var bundleVariety = (BundleItem.BundleVariety)twilightSavedBundle.bundleVariety;
var isNotDefaultBundle = bundleVariety != BundleItem.BundleVariety.DefaultNoteFiles && bundleVariety != BundleItem.BundleVariety.DefaultUI;
@@ -987,22 +1009,22 @@
var bundleEntryPath = Path.Combine(QwilightComponent.BundleEntryPath, twilightSavedBundle.bundleName);
using (var zipFile = ZipFile.Read(dataFlow))
{
- savingBundleItem.Text = LanguageSystem.Instance.SavingBundleContents;
+ bundleNotifyItem.Text = LanguageSystem.Instance.SavingBundleContents;
if (isNotDefaultBundle)
{
- NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Info, NotifySystem.NotifyConfigure.NotSave, savingBundleItem.Text, false, null, null, NotifySystem.SaveBundleID);
+ NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Info, NotifySystem.NotifyConfigure.NotSave, bundleNotifyItem.Text, false, null, null, NotifySystem.SaveBundleID);
}
zipFile.ExtractProgress += OnSavingZipFile;
zipFile.ExtractAll(bundleEntryPath, ExtractExistingFileAction.OverwriteSilently);
}
- if (!savingBundleItem.IsStopped)
+ if (!bundleNotifyItem.IsStopped)
{
mainViewModel.LoadEntryItem(DefaultEntryItem.EssentialBundle, bundleEntryPath, isNotDefaultBundle);
- savingBundleItem.Variety = NotifySystem.NotifyVariety.Quit;
- savingBundleItem.Text = LanguageSystem.Instance.SavedBundleContents;
+ bundleNotifyItem.Variety = NotifySystem.NotifyVariety.Stopped;
+ bundleNotifyItem.Text = LanguageSystem.Instance.SavedBundleContents;
if (isNotDefaultBundle)
{
- NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.OK, NotifySystem.NotifyConfigure.NotSave, savingBundleItem.Text, false, null, null, NotifySystem.SaveBundleID);
+ NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.OK, NotifySystem.NotifyConfigure.NotSave, bundleNotifyItem.Text, false, null, null, NotifySystem.SaveBundleID);
}
else if (twilightSavedBundle.isLastDefault)
{
@@ -1014,21 +1036,21 @@
case BundleItem.BundleVariety.UI:
using (var zipFile = ZipFile.Read(dataFlow))
{
- savingBundleItem.Text = LanguageSystem.Instance.SavingBundleContents;
+ bundleNotifyItem.Text = LanguageSystem.Instance.SavingBundleContents;
if (isNotDefaultBundle)
{
- NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Info, NotifySystem.NotifyConfigure.NotSave, savingBundleItem.Text, false, null, null, NotifySystem.SaveBundleID);
+ NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Info, NotifySystem.NotifyConfigure.NotSave, bundleNotifyItem.Text, false, null, null, NotifySystem.SaveBundleID);
}
zipFile.ExtractProgress += OnSavingZipFile;
zipFile.ExtractAll(string.IsNullOrEmpty(Path.GetDirectoryName(zipFile.Where(zipEntry => zipEntry.FileName.IsTailCaselsss(".yaml")).OrderBy(zipEntry => zipEntry.FileName).FirstOrDefault().FileName)) ? Path.Combine(QwilightComponent.UIEntryPath, twilightSavedBundle.bundleName) : QwilightComponent.UIEntryPath, ExtractExistingFileAction.OverwriteSilently);
}
- if (!savingBundleItem.IsStopped)
+ if (!bundleNotifyItem.IsStopped)
{
- savingBundleItem.Variety = NotifySystem.NotifyVariety.Quit;
- savingBundleItem.Text = LanguageSystem.Instance.SavedBundleContents;
+ bundleNotifyItem.Variety = NotifySystem.NotifyVariety.Stopped;
+ bundleNotifyItem.Text = LanguageSystem.Instance.SavedBundleContents;
if (isNotDefaultBundle)
{
- NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.OK, NotifySystem.NotifyConfigure.NotSave, savingBundleItem.Text, false, null, null, NotifySystem.SaveBundleID);
+ NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.OK, NotifySystem.NotifyConfigure.NotSave, bundleNotifyItem.Text, false, null, null, NotifySystem.SaveBundleID);
}
else if (twilightSavedBundle.isLastDefault)
{
@@ -1041,9 +1063,9 @@
{
dataFlow.CopyTo(fs);
}
- savingBundleItem.Variety = NotifySystem.NotifyVariety.Quit;
- savingBundleItem.Text = LanguageSystem.Instance.SavedQwilightBundleContents;
- NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Info, NotifySystem.NotifyConfigure.NotSave, savingBundleItem.Text, false, null, null, NotifySystem.SaveBundleID);
+ bundleNotifyItem.Variety = NotifySystem.NotifyVariety.Stopped;
+ bundleNotifyItem.Text = LanguageSystem.Instance.SavedQwilightBundleContents;
+ NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Info, NotifySystem.NotifyConfigure.NotSave, bundleNotifyItem.Text, false, null, null, NotifySystem.SaveBundleID);
break;
case BundleItem.BundleVariety.EventNote:
try
@@ -1058,9 +1080,9 @@
};
var date = DateTime.Now;
DB.Instance.SetEventNote(eventNoteID, eventNoteName, date, eventNoteVariety);
- savingBundleItem.Variety = NotifySystem.NotifyVariety.Quit;
- savingBundleItem.Text = LanguageSystem.Instance.SavedBundleContents;
- NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.OK, NotifySystem.NotifyConfigure.NotSave, savingBundleItem.Text, false, null, null, NotifySystem.SaveBundleID);
+ bundleNotifyItem.Variety = NotifySystem.NotifyVariety.Stopped;
+ bundleNotifyItem.Text = LanguageSystem.Instance.SavedBundleContents;
+ NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.OK, NotifySystem.NotifyConfigure.NotSave, bundleNotifyItem.Text, false, null, null, NotifySystem.SaveBundleID);
mainViewModel.LoadEventNoteEntryItems();
mainViewModel.Want();
}
@@ -1075,30 +1097,30 @@
{
using (var zipFile = ZipFile.Read(dataFlow))
{
- savingBundleItem.Text = LanguageSystem.Instance.SavingBundleContents;
- NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Info, NotifySystem.NotifyConfigure.NotSave, savingBundleItem.Text, false, null, null, NotifySystem.SaveBundleID);
+ bundleNotifyItem.Text = LanguageSystem.Instance.SavingBundleContents;
+ NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Info, NotifySystem.NotifyConfigure.NotSave, bundleNotifyItem.Text, false, null, null, NotifySystem.SaveBundleID);
zipFile.ExtractProgress += OnSavingZipFile;
zipFile.ExtractAll(noteFile.EntryItem.EntryPath, ExtractExistingFileAction.OverwriteSilently);
}
- if (!savingBundleItem.IsStopped)
+ if (!bundleNotifyItem.IsStopped)
{
mainViewModel.LoadEntryItem(noteFile.DefaultEntryItem, noteFile.EntryItem.EntryPath);
- savingBundleItem.Variety = NotifySystem.NotifyVariety.Quit;
- savingBundleItem.Text = LanguageSystem.Instance.SavedBundleContents;
- NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.OK, NotifySystem.NotifyConfigure.NotSave, savingBundleItem.Text, false, null, null, NotifySystem.SaveBundleID);
+ bundleNotifyItem.Variety = NotifySystem.NotifyVariety.Stopped;
+ bundleNotifyItem.Text = LanguageSystem.Instance.SavedBundleContents;
+ NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.OK, NotifySystem.NotifyConfigure.NotSave, bundleNotifyItem.Text, false, null, null, NotifySystem.SaveBundleID);
}
}
else
{
- savingBundleItem.Text = LanguageSystem.Instance.NotHaveNoteFileEntryText;
- NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Warning, NotifySystem.NotifyConfigure.NotSave, savingBundleItem.Text, false, null, null, NotifySystem.SaveBundleID);
+ bundleNotifyItem.Text = LanguageSystem.Instance.NotHaveNoteFileEntryText;
+ NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Warning, NotifySystem.NotifyConfigure.NotSave, bundleNotifyItem.Text, false, null, null, NotifySystem.SaveBundleID);
}
break;
}
void OnSavingZipFile(object sender, ExtractProgressEventArgs e)
{
- if (savingBundleItem.IsStopped)
+ if (bundleNotifyItem.IsStopped)
{
e.Cancel = true;
}
@@ -1106,20 +1128,20 @@
{
if (e.EntriesTotal > 0)
{
- savingBundleItem.Status = e.EntriesExtracted;
- savingBundleItem.MaxStatus = e.EntriesTotal;
+ bundleNotifyItem.Status = e.EntriesExtracted;
+ bundleNotifyItem.MaxStatus = e.EntriesTotal;
}
}
}
}
catch (Exception e)
{
- savingBundleItem.OnStop(false);
+ bundleNotifyItem.OnStop(false);
NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Fault, NotifySystem.NotifyConfigure.Default, string.Format(LanguageSystem.Instance.SaveBundleFault, e.Message), false, null, null, NotifySystem.SaveBundleID);
}
finally
{
- savingBundleItem.Dispose();
+ bundleNotifyItem.Dispose();
}
}, false);
}
diff --git a/Qwilight/UIComponent/NotifyItem.cs b/Qwilight/UIComponent/NotifyItem.cs
index 6a6315f..b246811 100644
--- a/Qwilight/UIComponent/NotifyItem.cs
+++ b/Qwilight/UIComponent/NotifyItem.cs
@@ -11,6 +11,8 @@
double _quitStatus;
string _text;
+ public AvatarWww AvatarWwwValue { get; set; }
+
public byte[] Data { get; set; }
public MemoryStream DataFlow { get; set; }
diff --git a/Qwilight/View/NetSiteCommentWindow.xaml b/Qwilight/View/NetSiteCommentWindow.xaml
index ef623ec..e3eb1f1 100644
--- a/Qwilight/View/NetSiteCommentWindow.xaml
+++ b/Qwilight/View/NetSiteCommentWindow.xaml
@@ -21,6 +21,13 @@
+
+
+
+
+
+
+
diff --git a/Qwilight/View/NotifyWindow.xaml b/Qwilight/View/NotifyWindow.xaml
index 88e0950..a8019d0 100644
--- a/Qwilight/View/NotifyWindow.xaml
+++ b/Qwilight/View/NotifyWindow.xaml
@@ -2,7 +2,7 @@
x:Class="Qwilight.View.NotifyWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+ xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:view="clr-namespace:Qwilight.View"
DataContext="{Binding NotifyValue, Source={StaticResource ViewModels}}"
Style="{StaticResource StandardModalWindow}">
@@ -11,37 +11,119 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Qwilight/View/NotifyWindow.xaml.cs b/Qwilight/View/NotifyWindow.xaml.cs
index 06fed92..ef1b842 100644
--- a/Qwilight/View/NotifyWindow.xaml.cs
+++ b/Qwilight/View/NotifyWindow.xaml.cs
@@ -7,8 +7,16 @@
{
public NotifyWindow() => InitializeComponent();
- void OnInputLower(object sender, KeyEventArgs e) => (DataContext as NotifyViewModel).OnInputLower(e);
+ void OnDefaultNotifyInputLower(object sender, KeyEventArgs e) => (DataContext as NotifyViewModel).OnDefaultNotifyInputLower(e);
- void OnPointLower(object sender, MouseButtonEventArgs e) => (DataContext as NotifyViewModel).OnPointLower(e);
+ void OnHandlingNotifyInputLower(object sender, KeyEventArgs e) => (DataContext as NotifyViewModel).OnHandlingNotifyInputLower(e);
+
+ void OnPassNotifyInputLower(object sender, KeyEventArgs e) => (DataContext as NotifyViewModel).OnPassNotifyInputLower(e);
+
+ void OnDefaultNotifyPointLower(object sender, MouseButtonEventArgs e) => (DataContext as NotifyViewModel).OnDefaultNotifyPointLower(e);
+
+ void OnHandlingNotifyPointLower(object sender, MouseButtonEventArgs e) => (DataContext as NotifyViewModel).OnHandlingNotifyPointLower(e);
+
+ void OnPassNotifyPointLower(object sender, MouseButtonEventArgs e) => (DataContext as NotifyViewModel).OnPassNotifyPointLower(e);
}
}
\ No newline at end of file
diff --git a/Qwilight/ViewModel/MainViewModel.cs b/Qwilight/ViewModel/MainViewModel.cs
index ea8d340..6b4dab7 100644
--- a/Qwilight/ViewModel/MainViewModel.cs
+++ b/Qwilight/ViewModel/MainViewModel.cs
@@ -592,7 +592,8 @@
if (IsNoteFileMode)
{
ViewModels.Instance.HandleSilentlyClosableViewModels(silentlyClosableViewModel => silentlyClosableViewModel.OpenSilently());
- NotifySystem.Instance.NotifyPending();
+ NotifySystem.Instance.NotifyPendingDefaultNotify();
+ NotifySystem.Instance.NotifyPendingPassNotify();
_randomMillis = Environment.TickCount64;
}
else
@@ -778,39 +779,39 @@
}
else
{
- var savingUIItem = new NotifyItem
+ var valueUINotifyItem = new NotifyItem
{
Text = LanguageSystem.Instance.SavingUIContents,
- Variety = NotifySystem.NotifyVariety.Levying,
+ Variety = NotifySystem.NotifyVariety.Handling,
OnStop = wipeTotal => false,
};
try
{
- UIHandler.Instance.HandleParallel(() => ViewModels.Instance.NotifyValue.NotifyItemCollection.Insert(0, savingUIItem));
- NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Info, NotifySystem.NotifyConfigure.NotSave, savingUIItem.Text, false, null, null, NotifySystem.SaveUIID);
+ UIHandler.Instance.HandleParallel(() => ViewModels.Instance.NotifyValue.HandlingNotifyItemCollection.Insert(0, valueUINotifyItem));
+ NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Info, NotifySystem.NotifyConfigure.NotSave, valueUINotifyItem.Text, false, null, null, NotifySystem.SaveUIID);
zipFile.ExtractProgress += (sender, e) =>
{
if (e.EntriesTotal > 0)
{
- savingUIItem.Status = e.EntriesExtracted;
- savingUIItem.MaxStatus = e.EntriesTotal;
+ valueUINotifyItem.Status = e.EntriesExtracted;
+ valueUINotifyItem.MaxStatus = e.EntriesTotal;
}
};
zipFile.ExtractAll(string.IsNullOrEmpty(Path.GetDirectoryName(yamlFileName)) ? Path.Combine(QwilightComponent.UIEntryPath, yamlFileName) : QwilightComponent.UIEntryPath, ExtractExistingFileAction.OverwriteSilently);
- savingUIItem.Variety = NotifySystem.NotifyVariety.Quit;
- savingUIItem.Text = LanguageSystem.Instance.SavedUIContents;
- NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.OK, NotifySystem.NotifyConfigure.Default, savingUIItem.Text, false, null, null, NotifySystem.SaveUIID);
+ valueUINotifyItem.Variety = NotifySystem.NotifyVariety.Stopped;
+ valueUINotifyItem.Text = LanguageSystem.Instance.SavedUIContents;
+ NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.OK, NotifySystem.NotifyConfigure.Default, valueUINotifyItem.Text, false, null, null, NotifySystem.SaveUIID);
lastYamlFileName = yamlFileName;
}
catch (Exception e)
{
- savingUIItem.Variety = NotifySystem.NotifyVariety.Stopped;
- savingUIItem.Text = string.Format(LanguageSystem.Instance.SaveUIFault, e.Message);
- NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Fault, NotifySystem.NotifyConfigure.Default, savingUIItem.Text, false, null, null, NotifySystem.SaveUIID);
+ valueUINotifyItem.Variety = NotifySystem.NotifyVariety.Cancelled;
+ valueUINotifyItem.Text = string.Format(LanguageSystem.Instance.SaveUIFault, e.Message);
+ NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Fault, NotifySystem.NotifyConfigure.Default, valueUINotifyItem.Text, false, null, null, NotifySystem.SaveUIID);
}
finally
{
- savingUIItem.OnStop = wipeTotal => true;
+ valueUINotifyItem.OnStop = wipeTotal => true;
}
}
}
@@ -1780,16 +1781,16 @@
public void HandleNoteBundle(string filePath)
{
- var savingNoteItem = new NotifyItem
+ var noteNotifyItem = new NotifyItem
{
Text = LanguageSystem.Instance.SavingNoteContents,
- Variety = NotifySystem.NotifyVariety.Levying,
+ Variety = NotifySystem.NotifyVariety.Handling,
OnStop = wipeTotal => false,
};
try
{
- UIHandler.Instance.HandleParallel(() => ViewModels.Instance.NotifyValue.NotifyItemCollection.Insert(0, savingNoteItem));
- NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Info, NotifySystem.NotifyConfigure.NotSave, savingNoteItem.Text, false, null, null, NotifySystem.SaveFileID);
+ UIHandler.Instance.HandleParallel(() => ViewModels.Instance.NotifyValue.HandlingNotifyItemCollection.Insert(0, noteNotifyItem));
+ NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Info, NotifySystem.NotifyConfigure.NotSave, noteNotifyItem.Text, false, null, null, NotifySystem.SaveFileID);
var bundleEntryItem = Configure.Instance.LastDefaultEntryItem ?? DefaultEntryItem.EssentialBundle;
if (bundleEntryItem.DefaultEntryVarietyValue != DefaultEntryItem.DefaultEntryVariety.Default && bundleEntryItem.DefaultEntryVarietyValue != DefaultEntryItem.DefaultEntryVariety.Essential)
{
@@ -1804,8 +1805,8 @@
using IArchive rarLZMAFile = rar ? RarArchive.Open(filePath) : SevenZipArchive.Open(filePath);
rarLZMAFile.ExtractToDirectory(bundleEntryPath, status =>
{
- savingNoteItem.Status = 100.0 * status;
- savingNoteItem.MaxStatus = 100.0;
+ noteNotifyItem.Status = 100.0 * status;
+ noteNotifyItem.MaxStatus = 100.0;
});
}
else
@@ -1818,26 +1819,26 @@
{
if (e.EntriesTotal > 0)
{
- savingNoteItem.Status = e.EntriesExtracted;
- savingNoteItem.MaxStatus = e.EntriesTotal;
+ noteNotifyItem.Status = e.EntriesExtracted;
+ noteNotifyItem.MaxStatus = e.EntriesTotal;
}
};
zipFile.ExtractAll(bundleEntryPath, ExtractExistingFileAction.OverwriteSilently);
}
LoadEntryItem(bundleEntryItem, bundleEntryPath);
- savingNoteItem.Variety = NotifySystem.NotifyVariety.Quit;
- savingNoteItem.Text = LanguageSystem.Instance.SavedNoteContents;
- NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.OK, NotifySystem.NotifyConfigure.Default, savingNoteItem.Text, false, null, null, NotifySystem.SaveFileID);
+ noteNotifyItem.Variety = NotifySystem.NotifyVariety.Stopped;
+ noteNotifyItem.Text = LanguageSystem.Instance.SavedNoteContents;
+ NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.OK, NotifySystem.NotifyConfigure.Default, noteNotifyItem.Text, false, null, null, NotifySystem.SaveFileID);
}
catch (Exception e)
{
- savingNoteItem.Variety = NotifySystem.NotifyVariety.Stopped;
- savingNoteItem.Text = string.Format(LanguageSystem.Instance.SaveNoteFault, e.Message);
- NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Fault, NotifySystem.NotifyConfigure.Default, savingNoteItem.Text, false, null, null, NotifySystem.SaveFileID);
+ noteNotifyItem.Variety = NotifySystem.NotifyVariety.Cancelled;
+ noteNotifyItem.Text = string.Format(LanguageSystem.Instance.SaveNoteFault, e.Message);
+ NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Fault, NotifySystem.NotifyConfigure.Default, noteNotifyItem.Text, false, null, null, NotifySystem.SaveFileID);
}
finally
{
- savingNoteItem.OnStop = wipeTotal => true;
+ noteNotifyItem.OnStop = wipeTotal => true;
}
}
@@ -1977,7 +1978,7 @@
finally
{
LoadEventNoteEntryItems();
- NotifySystem.Instance.NotifyPending();
+ NotifySystem.Instance.NotifyPendingDefaultNotify();
ViewModels.Instance.SiteContainerValue.SetComputingValues();
Want();
Status = 0.0;
@@ -2017,7 +2018,7 @@
}
LoadEventNoteEntryItems();
Want(wantEntryItems?.LastOrDefault());
- NotifySystem.Instance.NotifyPending();
+ NotifySystem.Instance.NotifyPendingDefaultNotify();
ViewModels.Instance.SiteContainerValue.SetComputingValues();
}
@@ -3244,10 +3245,10 @@
public async Task GetQwilight(bool isSilent)
{
- var savingQwilightItem = new NotifyItem
+ var qwilightNotifyItem = new NotifyItem
{
Text = LanguageSystem.Instance.SavingQwilightContents,
- Variety = NotifySystem.NotifyVariety.Levying,
+ Variety = NotifySystem.NotifyVariety.Handling,
OnStop = wipeTotal => false
};
try
@@ -3278,8 +3279,8 @@
var data = ArrayPool.Shared.Rent(QwilightComponent.SendUnit);
try
{
- UIHandler.Instance.HandleParallel(() => ViewModels.Instance.NotifyValue.NotifyItemCollection.Insert(0, savingQwilightItem));
- NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Info, NotifySystem.NotifyConfigure.NotSave, savingQwilightItem.Text, false, null, null, NotifySystem.SaveQwilightID);
+ UIHandler.Instance.HandleParallel(() => ViewModels.Instance.NotifyValue.HandlingNotifyItemCollection.Insert(0, qwilightNotifyItem));
+ NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Info, NotifySystem.NotifyConfigure.NotSave, qwilightNotifyItem.Text, false, null, null, NotifySystem.SaveQwilightID);
var title = taehuiQwilightValue.title;
var tmpFileName = Path.GetTempFileName();
var target = $"{QwilightComponent.TaehuiNetFE}/qwilight/{title}";
@@ -3287,7 +3288,7 @@
{
using (var hrm = await wwwClient.GetAsync(target, HttpCompletionOption.ResponseHeadersRead).ConfigureAwait(false))
{
- savingQwilightItem.MaxStatus = hrm.Content.Headers.ContentLength ?? 0L;
+ qwilightNotifyItem.MaxStatus = hrm.Content.Headers.ContentLength ?? 0L;
}
using (var fs = File.OpenWrite(tmpFileName))
using (var ws = await wwwClient.GetStreamAsync(target).ConfigureAwait(false))
@@ -3296,13 +3297,13 @@
while ((length = await ws.ReadAsync(data.AsMemory(0, data.Length)).ConfigureAwait(false)) > 0)
{
await fs.WriteAsync(data.AsMemory(0, length));
- savingQwilightItem.Status += length;
+ qwilightNotifyItem.Status += length;
}
}
}
- savingQwilightItem.Variety = NotifySystem.NotifyVariety.Quit;
- savingQwilightItem.Text = LanguageSystem.Instance.SavedQwilightContents;
- savingQwilightItem.OnStop = wipeTotal =>
+ qwilightNotifyItem.Variety = NotifySystem.NotifyVariety.Stopped;
+ qwilightNotifyItem.Text = LanguageSystem.Instance.SavedQwilightContents;
+ qwilightNotifyItem.OnStop = wipeTotal =>
{
if (!wipeTotal)
{
@@ -3310,7 +3311,7 @@
}
return true;
};
- NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Info, NotifySystem.NotifyConfigure.NotSave, savingQwilightItem.Text);
+ NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Info, NotifySystem.NotifyConfigure.NotSave, qwilightNotifyItem.Text);
var qwilightFileName = Path.ChangeExtension(tmpFileName, Path.GetExtension(title));
Utility.MoveFile(tmpFileName, qwilightFileName);
_qwilightFileName = qwilightFileName;
@@ -3326,8 +3327,8 @@
{
if (!isSilent)
{
- savingQwilightItem.Text = string.Format(LanguageSystem.Instance.GetQwilightFault, e.Message);
- NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Fault, NotifySystem.NotifyConfigure.NotSave, savingQwilightItem.Text);
+ qwilightNotifyItem.Text = string.Format(LanguageSystem.Instance.GetQwilightFault, e.Message);
+ NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.Fault, NotifySystem.NotifyConfigure.NotSave, qwilightNotifyItem.Text);
}
}
}
diff --git a/Qwilight/ViewModel/NotifyViewModel.cs b/Qwilight/ViewModel/NotifyViewModel.cs
index a83048d..29c669e 100644
--- a/Qwilight/ViewModel/NotifyViewModel.cs
+++ b/Qwilight/ViewModel/NotifyViewModel.cs
@@ -8,7 +8,10 @@
{
public sealed partial class NotifyViewModel : BaseViewModel
{
- NotifyItem _toNotifyItemValue;
+ int _tabPosition;
+ NotifyItem _defaultNotifyItemValue;
+ NotifyItem _handlingNotifyItemValue;
+ NotifyItem _passNotifyItemValue;
public override double TargetLength => 0.8;
@@ -16,41 +19,130 @@
public override VerticalAlignment HeightSystem => VerticalAlignment.Top;
- public ObservableCollection NotifyItemCollection { get; } = new();
+ public ObservableCollection DefaultNotifyItemCollection { get; } = new();
- public NotifyItem NotifyItemValue
+ public ObservableCollection HandlingNotifyItemCollection { get; } = new();
+
+ public ObservableCollection PassNotifyItemCollection { get; } = new();
+
+ public string DefaultNotifyTitle => string.Format(LanguageSystem.Instance.DefaultNotify, DefaultNotifyItemCollection.Count);
+
+ public string HandlingNotifyTitle => string.Format(LanguageSystem.Instance.HandlingNotify, HandlingNotifyItemCollection.Count);
+
+ public string PassNotifyTitle => string.Format(LanguageSystem.Instance.PassNotify, PassNotifyItemCollection.Count);
+
+ public NotifyViewModel()
{
- get => _toNotifyItemValue;
-
- set => SetProperty(ref _toNotifyItemValue, value, nameof(NotifyItemValue));
+ DefaultNotifyItemCollection.CollectionChanged += (sender, e) => OnPropertyChanged(nameof(DefaultNotifyTitle));
+ HandlingNotifyItemCollection.CollectionChanged += (sender, e) => OnPropertyChanged(nameof(HandlingNotifyTitle));
+ PassNotifyItemCollection.CollectionChanged += (sender, e) => OnPropertyChanged(nameof(PassNotifyTitle));
}
- public void OnInputLower(KeyEventArgs e)
+ public int TabPosition
+ {
+ get => _tabPosition;
+
+ set => SetProperty(ref _tabPosition, value, nameof(TabPosition));
+ }
+
+ public NotifyItem DefaultNotifyItemValue
+ {
+ get => _defaultNotifyItemValue;
+
+ set => SetProperty(ref _defaultNotifyItemValue, value, nameof(DefaultNotifyItemValue));
+ }
+
+ public NotifyItem HandlingNotifyItemValue
+ {
+ get => _handlingNotifyItemValue;
+
+ set => SetProperty(ref _handlingNotifyItemValue, value, nameof(HandlingNotifyItemValue));
+ }
+
+ public NotifyItem PassNotifyItemValue
+ {
+ get => _passNotifyItemValue;
+
+ set => SetProperty(ref _passNotifyItemValue, value, nameof(PassNotifyItemValue));
+ }
+
+ public void OnDefaultNotifyInputLower(KeyEventArgs e)
{
if (e.Key == Key.Delete)
{
- var toNotifyItemValue = NotifyItemValue;
- if (toNotifyItemValue?.OnStop?.Invoke(false) != false)
+ var defaultNotifyItem = DefaultNotifyItemValue;
+ if (defaultNotifyItem?.OnStop?.Invoke(false) != false)
{
- NotifyItemCollection.Remove(toNotifyItemValue);
+ DefaultNotifyItemCollection.Remove(defaultNotifyItem);
}
}
}
- public void OnPointLower(MouseButtonEventArgs e)
+ public void OnHandlingNotifyInputLower(KeyEventArgs e)
{
- NotifyItemValue?.OnHandle?.Invoke();
+ if (e.Key == Key.Delete)
+ {
+ var handlingNotifyItem = HandlingNotifyItemValue;
+ if (handlingNotifyItem?.OnStop?.Invoke(false) != false)
+ {
+ HandlingNotifyItemCollection.Remove(handlingNotifyItem);
+ }
+ }
+ }
+
+ public void OnPassNotifyInputLower(KeyEventArgs e)
+ {
+ if (e.Key == Key.Delete)
+ {
+ var passNotifyItem = PassNotifyItemValue;
+ if (passNotifyItem?.OnStop?.Invoke(false) != false)
+ {
+ PassNotifyItemCollection.Remove(passNotifyItem);
+ }
+ }
+ }
+
+ public void OnDefaultNotifyPointLower(MouseButtonEventArgs e) => DefaultNotifyItemValue?.OnHandle?.Invoke();
+
+ public void OnHandlingNotifyPointLower(MouseButtonEventArgs e) => HandlingNotifyItemValue?.OnHandle?.Invoke();
+
+ public void OnPassNotifyPointLower(MouseButtonEventArgs e) => PassNotifyItemValue?.OnHandle?.Invoke();
+
+ [RelayCommand]
+ void OnWipeTotalDefaultNotify()
+ {
+ for (var i = DefaultNotifyItemCollection.Count - 1; i >= 0; --i)
+ {
+ var defaultNotifyItem = DefaultNotifyItemCollection[i];
+ if (defaultNotifyItem.OnStop?.Invoke(true) != false)
+ {
+ DefaultNotifyItemCollection.Remove(defaultNotifyItem);
+ }
+ }
}
[RelayCommand]
- void OnWipeTotalNotify()
+ void OnWipeTotalHandlingNotify()
{
- for (var i = NotifyItemCollection.Count - 1; i >= 0; --i)
+ for (var i = HandlingNotifyItemCollection.Count - 1; i >= 0; --i)
{
- var toNotifyItemValue = NotifyItemCollection[i];
- if (toNotifyItemValue.OnStop?.Invoke(true) != false)
+ var handlingNotifyItem = HandlingNotifyItemCollection[i];
+ if (handlingNotifyItem.OnStop?.Invoke(true) != false)
{
- NotifyItemCollection.Remove(toNotifyItemValue);
+ HandlingNotifyItemCollection.Remove(handlingNotifyItem);
+ }
+ }
+ }
+
+ [RelayCommand]
+ void OnWipeTotalPassNotify()
+ {
+ for (var i = PassNotifyItemCollection.Count - 1; i >= 0; --i)
+ {
+ var passNotifyItem = PassNotifyItemCollection[i];
+ if (passNotifyItem.OnStop?.Invoke(true) != false)
+ {
+ PassNotifyItemCollection.Remove(passNotifyItem);
}
}
}