diff --git a/Qwilight/Assets/Language.json b/Qwilight/Assets/Language.json index b2c3b9f..60acaab 100644 --- a/Qwilight/Assets/Language.json +++ b/Qwilight/Assets/Language.json @@ -1109,11 +1109,11 @@ }, "FlowVeilDrawingContents": { "ko-KR": "클리어 후 레인 커버가 레인을 자연스럽게 가립니다.", - "en-US": "After clearing, the rain cover covers the lane naturally." + "en-US": "After clearing, the lane cover covers the lane naturally." }, "FlowVeilDrawingText": { "ko-KR": "레인 커버 슬라이드 활성화", - "en-US": "Enable rain cover slide" + "en-US": "Enable lane cover slide" }, "FontFamilyAssist": { "ko-KR": "텍스트를 입력하여 글꼴 미리보기", @@ -1811,10 +1811,6 @@ "ko-KR": "CORSAIR® iCUE™ 활성화", "en-US": "Enable CORSAIR® iCUE™" }, - "LazyGCFault": { - "ko-KR": "게임 플레이 중 GC가 발생한 것 같습니다. 고급 설정에서 미리 예약한 메모리를 늘려주세요", - "en-US": "It appears that GC occurred during gameplay. Please increase the pre-reserved memory in advanced settings." - }, "LazyGCText": { "ko-KR": "게임 플레이 중 메모리를 미리 예약하여 GC 스파이크로 인한 스터터링을 방지합니다.", "en-US": "Pre-reserve memory during gameplay to prevent stuttering due to GC spikes." @@ -2247,9 +2243,9 @@ "ko-KR": "{0}이 {1}를 적용함", "en-US": "{0} applies {1}" }, - "NewDefaultAudioFilePath": { - "ko-KR": "커스텀 BGM 추가", - "en-US": "Add a custom BGM" + "New": { + "ko-KR": "추가", + "en-US": "Add" }, "NewDefaultEntry": { "ko-KR": "폴더 추가", @@ -2267,10 +2263,6 @@ "ko-KR": "새 컬렉션의 이름을 입력하세요", "en-US": "Please enter a name for the new collection" }, - "NewFrontEntry": { - "ko-KR": "의존 폴더 추가", - "en-US": "Add dependent folder" - }, "NewNetSiteContents": { "ko-KR": "멀티방 이름과 비밀번호를 입력하세요", "en-US": "Enter the name and password of the multi-room" @@ -2473,7 +2465,7 @@ }, "NotFlowVeilDrawingText": { "ko-KR": "레인 커버 슬라이드 비활성화", - "en-US": "Disable rain cover slide" + "en-US": "Disable lane cover slide" }, "NotGSText": { "ko-KR": "SteelSeries® GameSense™ 비활성화", @@ -3507,6 +3499,10 @@ "ko-KR": "레인 커버 높이", "en-US": "Lane Cover Height" }, + "VeilDrawingText": { + "ko-KR": "커스텀 레인 커버 목록", + "en-US": "Custom Lane Cover List" + }, "VESAContents": { "ko-KR": "수직 동기화를 사용합니다.", "en-US": "V-Sync setting" diff --git a/Qwilight/Assets/UI/Default/Default.lua b/Qwilight/Assets/UI/Default/Default.lua index bed55a0..16cc598 100644 --- a/Qwilight/Assets/UI/Default/Default.lua +++ b/Qwilight/Assets/UI/Default/Default.lua @@ -33,13 +33,7 @@ end function _GetVeil() - if configures[5] == 0 then - return "[Veil 0, Veil 1, Veil 2]" - elseif configures[5] == 1 then - return "Veil 1" - elseif configures[5] == 2 then - return "Veil 2" - end + return "[Veil 0.jpg, Veil 1.jpg, Veil 2.jpg]" end function StatusPosition1() diff --git a/Qwilight/Assets/UI/Default/Default.yaml b/Qwilight/Assets/UI/Default/Default.yaml index 3794bf7..8aa5e3a 100644 --- a/Qwilight/Assets/UI/Default/Default.yaml +++ b/Qwilight/Assets/UI/Default/Default.yaml @@ -94,11 +94,6 @@ configure-3-1042: Classic (파란색), Default (노란색) configure-comment-3: Select a center note color. configure-comment-3-1042: 중앙 노트 색상을 선택합니다. - - configure-4: Hexagon, Rectangle, Triangle - configure-4-1042: 육각형, 사각형, 삼각형 - configure-comment-4: Select the lane cover. - configure-comment-4-1042: 레인 커버를 선택합니다. pipeline: 1, 26, 3, 4, 7, 101, 8, 57, 31, 102, 103, 61, 2, 6, 9, 10, 11, 12, 13, 14, 30, 28, 15, 16, 27, 29, 33, 35, 36, 37, 38, 39, 40, 43, 44, 46, 47, 48, 51, 58, 104 diff --git a/Qwilight/Compute/AutoCompute.cs b/Qwilight/Compute/AutoCompute.cs index 13f7b87..46e8161 100644 --- a/Qwilight/Compute/AutoCompute.cs +++ b/Qwilight/Compute/AutoCompute.cs @@ -86,6 +86,7 @@ public override void SetNoteFileMode(string faultText = null) { IsAutoMode = true; + FadingViewLayer = 1; ViewModels.Instance.MainValue.SetNoteFileMode(faultText); } diff --git a/Qwilight/Compute/DefaultCompute.cs b/Qwilight/Compute/DefaultCompute.cs index 28d1252..d9948a7 100644 --- a/Qwilight/Compute/DefaultCompute.cs +++ b/Qwilight/Compute/DefaultCompute.cs @@ -418,7 +418,7 @@ public virtual bool CanModifySalt => (IsSalt || ModeComponentValue.CanModifySalt) && string.IsNullOrEmpty(EventNoteEntryItem?.EventNoteID); - public int FadingViewLayer { get; set; } = 1; + public int FadingViewLayer { get; set; } public bool LoadedMedia { get; } = Configure.Instance.LoadedMedia; @@ -1071,12 +1071,22 @@ { SetStop = true; SetInheritedValues(); + if (IsF) + { + HandleUIAudio("At Failed"); + FadingViewLayer = 3; + } + else + { + FadingViewLayer = 2; + } ViewModels.Instance.MainValue.SetQuitMode(this); } public virtual void SetNoteFileMode(string faultText = null) { SetStop = true; + FadingViewLayer = 1; ViewModels.Instance.MainValue.SetNoteFileMode(faultText); } @@ -4637,7 +4647,6 @@ } else { - FadingViewLayer = IsF ? 3 : 2; SetQuitMode(); } } diff --git a/Qwilight/MSG/MoveVeilDrawingView.cs b/Qwilight/MSG/MoveVeilDrawingView.cs new file mode 100644 index 0000000..46fb65b --- /dev/null +++ b/Qwilight/MSG/MoveVeilDrawingView.cs @@ -0,0 +1,7 @@ +namespace Qwilight.MSG +{ + public sealed class MoveVeilDrawingView + { + public object Target { get; init; } + } +} \ No newline at end of file diff --git a/Qwilight/ModeComponent.cs b/Qwilight/ModeComponent.cs index 125e1ec..700ffb0 100644 --- a/Qwilight/ModeComponent.cs +++ b/Qwilight/ModeComponent.cs @@ -213,7 +213,7 @@ /// /// 계산된 스크롤 속도 /// - public double Multiplier => Math.Max(0.0, CanModifyMultiplier ? MultiplierValue / (BPM * AudioMultiplier) : SentMultiplier); + public double Multiplier => Math.Max(0.0, CanModifyMultiplier ? MultiplierValue / (Math.Abs(BPM) * AudioMultiplier) : SentMultiplier); public string IIDXMultiplierMillisText { @@ -1156,7 +1156,7 @@ public bool HigherMultiplier() { - var wasModified = SetMultiplier(MultiplierValue + BPM * AudioMultiplier * _multiplierUnit); + var wasModified = SetMultiplier(MultiplierValue + Math.Abs(BPM) * AudioMultiplier * _multiplierUnit); if (wasModified) { _multiplierUnit += 0.01; @@ -1166,7 +1166,7 @@ public bool LowerMultiplier() { - var wasModified = SetMultiplier(MultiplierValue - BPM * AudioMultiplier * _multiplierUnit); + var wasModified = SetMultiplier(MultiplierValue - Math.Abs(BPM) * AudioMultiplier * _multiplierUnit); if (wasModified) { _multiplierUnit += 0.01; diff --git a/Qwilight/Qwilight.csproj b/Qwilight/Qwilight.csproj index 8ad426e..e54fd1c 100644 --- a/Qwilight/Qwilight.csproj +++ b/Qwilight/Qwilight.csproj @@ -10,7 +10,7 @@ Qwilight.ico Taehui 불로그 - 1.16.33 + 1.16.34 true enable false diff --git a/Qwilight/System/BaseUI/BaseUI.cs b/Qwilight/System/BaseUI/BaseUI.cs index e394272..0f4d770 100644 --- a/Qwilight/System/BaseUI/BaseUI.cs +++ b/Qwilight/System/BaseUI/BaseUI.cs @@ -1650,10 +1650,10 @@ }).Where(handledMediaItem => handledMediaItem != null).ToArray(); } } - foreach (var (fileName, drawingItem) in drawingValues) + foreach (var (filePath, drawingItem) in drawingValues) { - var justFileName = Path.GetFileNameWithoutExtension(fileName); - switch (Path.GetDirectoryName(fileName)) + var justFileName = Path.GetFileNameWithoutExtension(filePath); + switch (Path.GetDirectoryName(filePath)) { case "Judgment": if (justFileName == "Total Notes") @@ -1714,10 +1714,10 @@ break; } } - foreach (var (fileName, defaultDrawing) in defaultDrawingValues) + foreach (var (filePath, defaultDrawing) in defaultDrawingValues) { - var justFileName = Path.GetFileNameWithoutExtension(fileName); - switch (Path.GetDirectoryName(fileName)) + var justFileName = Path.GetFileNameWithoutExtension(filePath); + switch (Path.GetDirectoryName(filePath)) { case "Default Entry": var fileNameContents = justFileName.Split(" "); @@ -1926,10 +1926,10 @@ break; } } - foreach (var (fileName, handledDrawingItem) in handledDrawingValues) + foreach (var (filePath, handledDrawingItem) in handledDrawingValues) { - var justFileName = Path.GetFileNameWithoutExtension(fileName); - switch (Path.GetDirectoryName(fileName)) + var justFileName = Path.GetFileNameWithoutExtension(filePath); + switch (Path.GetDirectoryName(filePath)) { case "Drawing": var fileNameContents = justFileName.Split(' '); diff --git a/Qwilight/System/Configure/Configure.cs b/Qwilight/System/Configure/Configure.cs index d1fb6ce..dcf04ce 100644 --- a/Qwilight/System/Configure/Configure.cs +++ b/Qwilight/System/Configure/Configure.cs @@ -169,7 +169,7 @@ readonly double[] _equalizers = new double[5]; bool _detailedConfigure; bool _isLoaded; - double _veilDrawingHeight; + double _valueVeilDrawingHeight; bool _totalLimiterVariety; bool _autoCompute; bool _windowedMode; @@ -575,15 +575,13 @@ public string DefaultDrawingFilePath { get; set; } - public string VeilDrawingFilePath { get; set; } - public double VeilDrawingHeight { - get => _veilDrawingHeight; + get => _valueVeilDrawingHeight; set { - if (SetProperty(ref _veilDrawingHeight, value, nameof(VeilDrawingHeightContents)) && _isLoaded) + if (SetProperty(ref _valueVeilDrawingHeight, value, nameof(VeilDrawingHeightContents)) && _isLoaded) { ViewModels.Instance.MainValue.ModeComponentValue.NotifyIIDXMultiplierMillisText(); } @@ -1027,6 +1025,8 @@ public Brush DefaultAudioVarietyPaint => Paints.PointPaints[DefaultAudioVarietyValue != DefaultAudioVariety.Not ? 1 : 0]; + public VeilDrawingItem[] VeilDrawingItems { get; set; } + public string BanalMediaFilePath { get; set; } public string BanalFailedMediaFilePath { get; set; } @@ -3351,7 +3351,6 @@ { DefaultAudioVarietyValue = DefaultAudioVariety.UI; DefaultDrawingFilePath = string.Empty; - VeilDrawingFilePath = string.Empty; VeilDrawingHeight = 0.0; } if (isInit || Utility.IsLowerDate(Date, 1, 16, 0)) @@ -3489,6 +3488,10 @@ UIPipelineJudgmentVSVisualizer = true; JudgmentVSVisualizers = [true, false, false, false, false, false]; } + if (isInit || Utility.IsLowerDate(Date, 1, 16, 34)) + { + VeilDrawingItems = []; + } if (!UIConfigureValuesV2.ContainsKey(UIItemValue.Title)) { UIConfigureValuesV2[UIItemValue.Title] = new(); diff --git a/Qwilight/System/DrawingSystem/DrawingSystem.cs b/Qwilight/System/DrawingSystem/DrawingSystem.cs index d1a3136..1cb79f7 100644 --- a/Qwilight/System/DrawingSystem/DrawingSystem.cs +++ b/Qwilight/System/DrawingSystem/DrawingSystem.cs @@ -76,7 +76,7 @@ static readonly string FaultEntryPath = Path.Combine(QwilightComponent.FaultEntryPath, nameof(DrawingSystem)); readonly DrawingContainer _defaultDrawingContainer = new(); - readonly DrawingContainer _veilDrawingContainer = new(); + readonly DrawingContainer _valueVeilDrawingContainer = new(); /// /// Direct2D™ 싱글 스레드 제어용 락 /// @@ -220,7 +220,53 @@ }; DefaultDrawing = ClearedDrawing; - VeilDrawings = [ClearedDrawing]; + } + + public ConcurrentDictionary VeilDrawings { get; } = new(); + + HandledDrawingItem? GetVeilDrawing(long randomMillis) + { + var valueVeilDrawings = VeilDrawings.Values.ToArray(); + var valueVeilDrawingFileNamesLength = valueVeilDrawings.Length; + return valueVeilDrawingFileNamesLength > 0 ? valueVeilDrawings[randomMillis % valueVeilDrawingFileNamesLength] : null; + } + + public void WipeVeilDrawing(VeilDrawingItem valueVeilDrawingItem) + { + if (VeilDrawings.TryRemove(valueVeilDrawingItem, out var valueVeilDrawing)) + { + valueVeilDrawing.Dispose(); + } + } + + public void LoadVeilDrawing(VeilDrawingItem valueVeilDrawingItem) + { + WipeVeilDrawing(valueVeilDrawingItem); + try + { + var filePath = valueVeilDrawingItem.FilePath; + if (File.Exists(filePath)) + { + var valueVeilDrawing = new HandledDrawingItem() + { + DefaultDrawing = LoadDefault(filePath, null), + Drawing = Load(filePath, null) + }; + valueVeilDrawingItem.VeilDrawing = valueVeilDrawing; + VeilDrawings[valueVeilDrawingItem] = valueVeilDrawing; + } + } + catch + { + } + } + + public void LoadVeilDrawings() + { + foreach (var valueVeilDrawingItem in Configure.Instance.VeilDrawingItems) + { + LoadVeilDrawing(valueVeilDrawingItem); + } } public ConcurrentQueue<(Point, bool)> LastPointedQueue { get; } = new(); @@ -239,8 +285,6 @@ public HandledDrawingItem DefaultDrawing { get; set; } - public HandledDrawingItem[] VeilDrawings { get; set; } - public CanvasTextFormat MeterFont { get; } public CanvasTextFormat UtilityFont { get; } @@ -294,32 +338,6 @@ OnPropertyChanged(nameof(DefaultDrawing)); } - public void LoadVeilDrawing() - { - Close(_veilDrawingContainer); - try - { - var filePath = Configure.Instance.VeilDrawingFilePath; - if (File.Exists(filePath)) - { - VeilDrawings = [new HandledDrawingItem - { - Drawing = Load(filePath, _veilDrawingContainer), - DefaultDrawing = LoadDefault(filePath, _veilDrawingContainer) - }]; - } - else - { - VeilDrawings = UI.Instance.VeilDrawings.Count > 0 ? UI.Instance.VeilDrawings.ToArray() : [ClearedDrawing]; - } - } - catch - { - VeilDrawings = [ClearedDrawing]; - } - OnPropertyChanged(nameof(VeilDrawings)); - } - public void HandleSystem() { Span judgments = stackalloc int[6]; @@ -1765,18 +1783,19 @@ } break; case PaintPipelineID.VeilDrawing: - var veilDrawing = VeilDrawings.ElementAtOrDefault(defaultComputer.Salt % VeilDrawings.Length).Drawing; - if (veilDrawing.HasValue) + var salt = defaultComputer.Salt; + var valueVeilDrawing = (GetVeilDrawing(salt) ?? UI.Instance.GetVeilDrawing(salt) ?? ClearedDrawing).Drawing; + if (valueVeilDrawing.HasValue) { - var veilDrawingValue = veilDrawing.Value; - var veilDrawingBound = veilDrawingValue.DrawingBound; - var veilDrawingHeight = veilDrawingBound.Height * p1Length / veilDrawingBound.Length; - r.Set(mainPosition, defaultComputer.VeilDrawingHeight.Value - veilDrawingHeight, p1Length, veilDrawingHeight); - targetSession.PaintDrawing(ref r, veilDrawing); + var valueVeilDrawingValue = valueVeilDrawing.Value; + var valueVeilDrawingBound = valueVeilDrawingValue.DrawingBound; + var valueVeilDrawingHeight = valueVeilDrawingBound.Height * p1Length / valueVeilDrawingBound.Length; + r.Set(mainPosition, defaultComputer.VeilDrawingHeight.Value - valueVeilDrawingHeight, p1Length, valueVeilDrawingHeight); + targetSession.PaintDrawing(ref r, valueVeilDrawing); if (has2P) { r.Position0 += distance2P; - targetSession.PaintDrawing(ref r, veilDrawing); + targetSession.PaintDrawing(ref r, valueVeilDrawing); } } break; diff --git a/Qwilight/System/LanguageSystem/LanguageSystem.g.cs b/Qwilight/System/LanguageSystem/LanguageSystem.g.cs index cef39c8..f80e263 100644 --- a/Qwilight/System/LanguageSystem/LanguageSystem.g.cs +++ b/Qwilight/System/LanguageSystem/LanguageSystem.g.cs @@ -455,7 +455,6 @@ public string JudgmentVSVisualizerContents { get; set; } public string K70Contents { get; set; } public string K70Text { get; set; } - public string LazyGCFault { get; set; } public string LazyGCText { get; set; } public string Level0Contents { get; set; } public string Level1Contents { get; set; } @@ -564,12 +563,11 @@ public string NetTabText { get; set; } public string NetUIContents { get; set; } public string NeutralPostedItemText { get; set; } - public string NewDefaultAudioFilePath { get; set; } + public string New { get; set; } public string NewDefaultEntry { get; set; } public string NewEventNote { get; set; } public string NewFavoriteEntry { get; set; } public string NewFavoriteEntryContents { get; set; } - public string NewFrontEntry { get; set; } public string NewNetSiteContents { get; set; } public string NewNetSiteText { get; set; } public string NewSilentSite { get; set; } @@ -879,6 +877,7 @@ public string ValveEnrollText { get; set; } public string VeilDrawingContents { get; set; } public string VeilDrawingHeightContents { get; set; } + public string VeilDrawingText { get; set; } public string VESAContents { get; set; } public string VESAText { get; set; } public string Vibration0 { get; set; } diff --git a/Qwilight/System/UI/UI.cs b/Qwilight/System/UI/UI.cs index cabd953..88552ae 100644 --- a/Qwilight/System/UI/UI.cs +++ b/Qwilight/System/UI/UI.cs @@ -236,8 +236,6 @@ public DrawingItem?[] HitPointsDrawings { get; } = new DrawingItem?[9]; - public List VeilDrawings { get; } = new(); - public DrawingItem? StatusDrawing { get; set; } public DrawingItem? StatusSliderDrawing { get; set; } @@ -288,6 +286,8 @@ public DrawingItem?[] PausedConfigureDrawings { get; } = new DrawingItem?[2]; + public List VeilDrawings { get; } = new(); + public bool HandleAudio(string audioFileName, string defaultFileName = null, PausableAudioHandler pausableAudioHandler = null, double fadeInLength = 0.0, int audioVariety = AudioSystem.SEAudio) { lock (LoadedCSX) @@ -315,6 +315,13 @@ public string FaultText { get; set; } + public HandledDrawingItem? GetVeilDrawing(long randomMillis) + { + var valueVeilDrawingItems = VeilDrawings.ToArray(); + var defaultAudioFileNamesLength = valueVeilDrawingItems.Length; + return defaultAudioFileNamesLength > 0 ? valueVeilDrawingItems[randomMillis % defaultAudioFileNamesLength] : null; + } + public UI() => Init(); void LoadUIImpl(UIItem src, UIItem target) @@ -1470,7 +1477,7 @@ var drawingValues = new ConcurrentDictionary(); var handledDrawingValues = new ConcurrentDictionary(); var zipFilePath = Path.Combine(QwilightComponent.UIEntryPath, target.UIEntry, Path.ChangeExtension(zipName, "zip")); - var fileNames = new HashSet(); + var filePaths = new HashSet(); if (File.Exists(zipFilePath)) { using var zipFile = new ZipFile(zipFilePath); @@ -1486,16 +1493,17 @@ } foreach (var pausedFileName in new[] { "Configure 0.png", "Configure 1.png", "Stop 0.png", "Stop 1.png", "Undo 0.png", "Undo 1.png", "Unpause 0.png", "Unpause 1.png" }) { - if (!fileNames.Contains($"Paused/{pausedFileName}")) + if (!filePaths.Contains($"Paused/{pausedFileName}")) { SetDrawing($"Paused/{pausedFileName}", File.OpenRead(Path.Combine(QwilightComponent.AssetsEntryPath, "Paused", pausedFileName))); } } - void SetDrawing(string fileName, Stream s) + void SetDrawing(string filePath, Stream s) { - var justFileName = Path.GetFileNameWithoutExtension(fileName); - fileNames.Add(fileName); - switch (Path.GetDirectoryName(fileName)) + var justFileName = Path.GetFileNameWithoutExtension(filePath); + var fileName = Path.GetFileName(filePath); + filePaths.Add(filePath); + switch (Path.GetDirectoryName(filePath)) { case "Audio": parallelItems.Add(() => @@ -1504,7 +1512,7 @@ { using (s) { - audioValues[fileName] = AudioSystem.Instance.Load(s, this, 1F, QwilightComponent.GetLoopingAudioComputer().IsMatch(justFileName)); + audioValues[filePath] = AudioSystem.Instance.Load(s, this, 1F, QwilightComponent.GetLoopingAudioComputer().IsMatch(justFileName)); } } catch @@ -1517,9 +1525,9 @@ NewDrawing(s, true); break; case "Drawing": - var veilFilePath = getVeil([]); - var veilFilePaths = GetMultipleVeilFilePathsComputer().IsMatch(veilFilePath) ? veilFilePath.Substring(veilFilePath.IndexOf('[') + 1, veilFilePath.LastIndexOf(']') - 1).Split(',').Select(text => text.Trim()) : [veilFilePath]; - if (veilFilePaths.Contains(justFileName)) + var valueVeilFileName = getVeil([]); + var valueVeilFileNames = GetMultipleVeilFilePathsComputer().IsMatch(valueVeilFileName) ? valueVeilFileName.Substring(valueVeilFileName.IndexOf('[') + 1, valueVeilFileName.LastIndexOf(']') - 1).Split(',').Select(text => text.Trim()) : [valueVeilFileName]; + if (valueVeilFileNames.Contains(fileName) || valueVeilFileNames.Contains(justFileName)) { NewHandledDrawing(s); } @@ -1538,7 +1546,7 @@ { using (s) { - drawingValues[fileName] = DrawingSystem.Instance.Load(s, this, setAverage); + drawingValues[filePath] = DrawingSystem.Instance.Load(s, this, setAverage); } } catch @@ -1553,7 +1561,7 @@ { try { - handledDrawingValues[fileName] = new HandledDrawingItem + handledDrawingValues[filePath] = new HandledDrawingItem { Drawing = DrawingSystem.Instance.Load(s, this), DefaultDrawing = DrawingSystem.Instance.LoadDefault(s, this) @@ -1574,19 +1582,19 @@ } Utility.HandleLowestlyParallelly(parallelItems, Configure.Instance.UIBin, parallelItem => parallelItem()); - foreach (var fileName in audioValues.Keys) + foreach (var filePath in audioValues.Keys) { - var justFileName = Path.GetFileNameWithoutExtension(fileName); - var audioItem = audioValues[fileName]; - if (Path.GetDirectoryName(fileName) == "Audio") + var justFileName = Path.GetFileNameWithoutExtension(filePath); + var audioItem = audioValues[filePath]; + if (Path.GetDirectoryName(filePath) == "Audio") { _audioItemMap[justFileName] = audioItem; } } - foreach (var (fileName, drawingItem) in drawingValues.OrderBy(drawingValue => drawingValue.Key)) + foreach (var (filePath, drawingItem) in drawingValues.OrderBy(drawingValue => drawingValue.Key)) { - var justFileName = Path.GetFileNameWithoutExtension(fileName); - switch (Path.GetDirectoryName(fileName)) + var justFileName = Path.GetFileNameWithoutExtension(filePath); + switch (Path.GetDirectoryName(filePath)) { case "Paint": var fileNameContents = justFileName.Split(' '); @@ -1979,15 +1987,16 @@ break; } } - foreach (var (fileName, handledDrawingItem) in handledDrawingValues.OrderBy(handledDrawingValue => handledDrawingValue.Key)) + foreach (var (filePath, handledDrawingItem) in handledDrawingValues.OrderBy(handledDrawingValue => handledDrawingValue.Key)) { - var justFileName = Path.GetFileNameWithoutExtension(fileName); - switch (Path.GetDirectoryName(fileName)) + var fileName = Path.GetFileName(filePath); + var justFileName = Path.GetFileNameWithoutExtension(filePath); + switch (Path.GetDirectoryName(filePath)) { case "Drawing": - var veilFilePath = getVeil([]); - var veilFilePaths = GetMultipleVeilFilePathsComputer().IsMatch(veilFilePath) ? veilFilePath.Substring(veilFilePath.IndexOf('[') + 1, veilFilePath.LastIndexOf(']') - 1).Split(',').Select(text => text.Trim()) : [veilFilePath]; - if (veilFilePaths.Contains(justFileName)) + var valueVeilFileName = getVeil([]); + var valueVeilFileNames = GetMultipleVeilFilePathsComputer().IsMatch(valueVeilFileName) ? valueVeilFileName.Substring(valueVeilFileName.IndexOf('[') + 1, valueVeilFileName.LastIndexOf(']') - 1).Split(',').Select(text => text.Trim()) : [valueVeilFileName]; + if (valueVeilFileNames.Contains(fileName) || valueVeilFileNames.Contains(justFileName)) { VeilDrawings.Add(handledDrawingItem); } @@ -2315,7 +2324,6 @@ lock (LoadedCSX) { LoadUIImpl(src, target); - DrawingSystem.Instance.LoadVeilDrawing(); } OnLoaded(); NotifySystem.Instance.Notify(NotifySystem.NotifyVariety.OK, NotifySystem.NotifyConfigure.Default, LanguageSystem.Instance.OpenedUIFileContents, true, null, null, NotifySystem.LoadUIID); @@ -2348,7 +2356,6 @@ lock (LoadedCSX) { LoadUIImpl(src, target); - DrawingSystem.Instance.LoadVeilDrawing(); } OnLoaded(); } @@ -2376,6 +2383,7 @@ DrawingSystem.Instance.OnModified(); AvatarTitleSystem.Instance.WipeAvatarTitles(); ViewModels.Instance.NotifyWindowViewModels(); + ViewModels.Instance.ConfigureValue.SetVeilDrawingItems(); ViewModels.Instance.ModifyModeComponentValue.SetModeComponentItems(); mainViewModel.NotifyModel(); } diff --git a/Qwilight/UIComponent/DefaultAudioFilePathItem.cs b/Qwilight/UIComponent/DefaultAudioFilePathItem.cs index 4bec99d..ae38caf 100644 --- a/Qwilight/UIComponent/DefaultAudioFilePathItem.cs +++ b/Qwilight/UIComponent/DefaultAudioFilePathItem.cs @@ -8,7 +8,7 @@ public string Value { get; init; } - public override bool Equals(object obj) => obj is DefaultAudioFilePathItem item && Equals(item); + public override bool Equals(object obj) => obj is DefaultAudioFilePathItem defaultAudioFilePathItem && Equals(defaultAudioFilePathItem); public bool Equals(DefaultAudioFilePathItem other) => Value == other.Value; diff --git a/Qwilight/UIComponent/VeilDrawingItem.cs b/Qwilight/UIComponent/VeilDrawingItem.cs new file mode 100644 index 0000000..9d0b81d --- /dev/null +++ b/Qwilight/UIComponent/VeilDrawingItem.cs @@ -0,0 +1,20 @@ +using System.Text.Json.Serialization; +using System.Windows.Media; + +namespace Qwilight.UIComponent +{ + public sealed class VeilDrawingItem + { + [JsonIgnore] + public Brush PointedPaint => Paints.DefaultPointedPaint; + + [JsonIgnore] + public HandledDrawingItem VeilDrawing { get; set; } + + public string FilePath { get; init; } + + public override bool Equals(object obj) => obj is VeilDrawingItem valueVeilDrawingItem && FilePath == valueVeilDrawingItem.FilePath; + + public override int GetHashCode() => FilePath.GetHashCode(); + } +} diff --git a/Qwilight/View/ConfigureWindow/ComputingGUIConfigureWindow.xaml b/Qwilight/View/ConfigureWindow/ComputingGUIConfigureWindow.xaml index 1d916c9..77cfcf7 100644 --- a/Qwilight/View/ConfigureWindow/ComputingGUIConfigureWindow.xaml +++ b/Qwilight/View/ConfigureWindow/ComputingGUIConfigureWindow.xaml @@ -128,7 +128,18 @@ - + + + + + + + + + + + + diff --git a/Qwilight/View/ConfigureWindow/ComputingGUIConfigureWindow.xaml.cs b/Qwilight/View/ConfigureWindow/ComputingGUIConfigureWindow.xaml.cs index 18b4d6f..ea16cdc 100644 --- a/Qwilight/View/ConfigureWindow/ComputingGUIConfigureWindow.xaml.cs +++ b/Qwilight/View/ConfigureWindow/ComputingGUIConfigureWindow.xaml.cs @@ -10,7 +10,7 @@ public ComputingGUIConfigureWindow() => InitializeComponent(); - void OnVeilDrawing(object sender, MouseButtonEventArgs e) => _ = (DataContext as ConfigureViewModel).OnVeilDrawing(); + void OnVeilDrawing(object sender, MouseButtonEventArgs e) => (DataContext as ConfigureViewModel).OnVeilDrawing(); void OnComputingPointed(object sender, DragStartedEventArgs e) => (DataContext as ConfigureViewModel).OnComputingPointed(); diff --git a/Qwilight/View/InputFavorLabelledWindow.xaml b/Qwilight/View/InputFavorLabelledWindow.xaml new file mode 100644 index 0000000..a6bf7f6 --- /dev/null +++ b/Qwilight/View/InputFavorLabelledWindow.xaml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Qwilight/View/InputFavorLabelledWindow.xaml.cs b/Qwilight/View/InputFavorLabelledWindow.xaml.cs new file mode 100644 index 0000000..264d9c3 --- /dev/null +++ b/Qwilight/View/InputFavorLabelledWindow.xaml.cs @@ -0,0 +1,14 @@ +using Qwilight.ViewModel; +using System.Windows; + +namespace Qwilight.View +{ + public sealed partial class InputFavorLabelledWindow + { + public InputFavorLabelledWindow() => InitializeComponent(); + + void OnMeterModified(object sender, RoutedPropertyChangedEventArgs e) => (DataContext as InputFavorLabelledViewModel).OnMeterModified(); + + void OnSetMeter(object sender, RoutedEventArgs e) => (DataContext as InputFavorLabelledViewModel).OnMeterModified(); + } +} \ No newline at end of file diff --git a/Qwilight/View/LabeledInputFavorWindow.xaml b/Qwilight/View/LabeledInputFavorWindow.xaml deleted file mode 100644 index a6bf7f6..0000000 --- a/Qwilight/View/LabeledInputFavorWindow.xaml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Qwilight/View/LabeledInputFavorWindow.xaml.cs b/Qwilight/View/LabeledInputFavorWindow.xaml.cs deleted file mode 100644 index 264d9c3..0000000 --- a/Qwilight/View/LabeledInputFavorWindow.xaml.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Qwilight.ViewModel; -using System.Windows; - -namespace Qwilight.View -{ - public sealed partial class InputFavorLabelledWindow - { - public InputFavorLabelledWindow() => InitializeComponent(); - - void OnMeterModified(object sender, RoutedPropertyChangedEventArgs e) => (DataContext as InputFavorLabelledViewModel).OnMeterModified(); - - void OnSetMeter(object sender, RoutedEventArgs e) => (DataContext as InputFavorLabelledViewModel).OnMeterModified(); - } -} \ No newline at end of file diff --git a/Qwilight/View/MainWindow/WPFView.xaml b/Qwilight/View/MainWindow/WPFView.xaml index f8da950..ae9ab22 100644 --- a/Qwilight/View/MainWindow/WPFView.xaml +++ b/Qwilight/View/MainWindow/WPFView.xaml @@ -34,9 +34,10 @@ - + + diff --git a/Qwilight/View/ModifyAudioFilePathWindow.xaml b/Qwilight/View/ModifyAudioFilePathWindow.xaml new file mode 100644 index 0000000..0c1c297 --- /dev/null +++ b/Qwilight/View/ModifyAudioFilePathWindow.xaml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + +