|
17 | 17 | using System.Windows.Controls; |
18 | 18 | using System.Collections.Specialized; |
19 | 19 | using System.Linq; |
| 20 | +using static OngekiFumenEditor.Base.Collections.SoflanList; |
| 21 | +using OngekiFumenEditor.Modules.FumenObjectPropertyBrowser; |
20 | 22 |
|
21 | 23 | namespace OngekiFumenEditor.Modules.FumenSoflanGroupListViewer.ViewModels |
22 | 24 | { |
@@ -47,11 +49,34 @@ private void OnEditorPropertyChanged(object sender, PropertyChangedEventArgs e) |
47 | 49 |
|
48 | 50 | public override PaneLocation PreferredLocation => PaneLocation.Bottom; |
49 | 51 |
|
| 52 | + private bool isShowPreviewModeSoflanPositionList = true; |
| 53 | + public bool IsShowPreviewModeSoflanPositionList |
| 54 | + { |
| 55 | + get => isShowPreviewModeSoflanPositionList; |
| 56 | + set => Set(ref isShowPreviewModeSoflanPositionList, value); |
| 57 | + } |
| 58 | + |
50 | 59 | private FumenVisualEditorViewModel editor; |
51 | 60 | private ListViewDragDropManager<SoflanGroupDisplayItemListViewBase> listDragManager; |
52 | 61 |
|
53 | 62 | private SoflanGroupWrapItemGroup displaySoflanGroupItemGroupRoot; |
54 | 63 |
|
| 64 | + public IEnumerable<SoflanPoint> DisplaySoflanPointList |
| 65 | + { |
| 66 | + get |
| 67 | + { |
| 68 | + if (CurrentSelectedSoflanGroupWrapItem is null) |
| 69 | + return Enumerable.Empty<SoflanPoint>(); |
| 70 | + if (Editor?.Fumen is not OngekiFumen fumen) |
| 71 | + return Enumerable.Empty<SoflanPoint>(); |
| 72 | + |
| 73 | + var soflanList = fumen.SoflansMap[CurrentSelectedSoflanGroupWrapItem.SoflanGroupId]; |
| 74 | + var points = IsShowPreviewModeSoflanPositionList ? soflanList.GetCachedSoflanPositionList_PreviewMode(fumen.BpmList) : soflanList.GetCachedSoflanPositionList_DesignMode(fumen.BpmList); |
| 75 | + |
| 76 | + return points; |
| 77 | + } |
| 78 | + } |
| 79 | + |
55 | 80 | private string createNewGroupName; |
56 | 81 | public string CreateNewGroupName |
57 | 82 | { |
@@ -85,7 +110,11 @@ public void CreateNewGroup() |
85 | 110 | public SoflanGroupWrapItem CurrentSelectedSoflanGroupWrapItem |
86 | 111 | { |
87 | 112 | get => currentSelectedSoflanGroupWrapItem; |
88 | | - set => Set(ref currentSelectedSoflanGroupWrapItem, value); |
| 113 | + set |
| 114 | + { |
| 115 | + Set(ref currentSelectedSoflanGroupWrapItem, value); |
| 116 | + NotifyOfPropertyChange(() => DisplaySoflanPointList); |
| 117 | + } |
89 | 118 | } |
90 | 119 |
|
91 | 120 | public SoflanGroupWrapItemGroup DisplaySoflanGroupItemGroupRoot |
@@ -156,6 +185,14 @@ IEnumerable<SoflanGroupDisplayItemListViewBase> visit(SoflanGroupDisplayItemList |
156 | 185 | CurrentSelectedSoflanGroupWrapItem = visit(DisplaySoflanGroupItemGroupRoot).OfType<SoflanGroupWrapItem>().FirstOrDefault(x => x.IsSelected); |
157 | 186 | } |
158 | 187 |
|
| 188 | + public void OnItemDoubleClick(SoflanPoint item) |
| 189 | + { |
| 190 | + if (Editor is null) |
| 191 | + return; |
| 192 | + |
| 193 | + Editor.ScrollTo(item.TGrid); |
| 194 | + } |
| 195 | + |
159 | 196 | private void ListDragManager_ProcessDrop(object sender, ProcessDropEventArgs<SoflanGroupDisplayItemListViewBase> e) |
160 | 197 | { |
161 | 198 | var placeTo = e.ItemsSource.ElementAtOrDefault(e.NewIndex); |
|
0 commit comments