修订版 | c147f391a805ec5ac17e8480a28f93290fc338fa (tree) |
---|---|
时间 | 2021-09-30 02:12:21 |
作者 | yyagi <yyagi.dtxmania@gmai...> |
Commiter | yyagi |
#42951 今更ですが、コンフィグでサブメニューから戻る際にカーソル位置が初期化されてしまう問題を修正。
@@ -65,6 +65,8 @@ namespace DTXMania | ||
65 | 65 | } |
66 | 66 | stMenuItemRight[] listMenu; |
67 | 67 | |
68 | + Stack<string> flowHistory; | |
69 | + | |
68 | 70 | /// <summary> |
69 | 71 | /// #32059 2013.9.17 yyagi |
70 | 72 | /// </summary> |
@@ -124,47 +126,47 @@ namespace DTXMania | ||
124 | 126 | |
125 | 127 | if (this.eメニュー種別 == Eメニュー種別.KeyAssignSystem) |
126 | 128 | { |
127 | - t項目リストの設定(Eメニュー種別.System); | |
129 | + t項目リストの設定(Eメニュー種別.System, true); | |
128 | 130 | } |
129 | 131 | else if (this.eメニュー種別 == Eメニュー種別.KeyAssignDrums) |
130 | 132 | { |
131 | - t項目リストの設定(Eメニュー種別.Drums); | |
133 | + t項目リストの設定(Eメニュー種別.Drums, true ); | |
132 | 134 | } |
133 | 135 | else if (this.eメニュー種別 == Eメニュー種別.KeyAssignGuitar) |
134 | 136 | { |
135 | - t項目リストの設定(Eメニュー種別.Guitar); | |
137 | + t項目リストの設定(Eメニュー種別.Guitar, true ); | |
136 | 138 | } |
137 | 139 | else if (this.eメニュー種別 == Eメニュー種別.KeyAssignBass) |
138 | 140 | { |
139 | - t項目リストの設定(Eメニュー種別.Bass); | |
141 | + t項目リストの設定(Eメニュー種別.Bass, true ); | |
140 | 142 | } |
141 | 143 | if (this.eメニュー種別 == Eメニュー種別.DisplaySystem) |
142 | 144 | { |
143 | - t項目リストの設定(Eメニュー種別.System); | |
145 | + t項目リストの設定(Eメニュー種別.System, true ); | |
144 | 146 | } |
145 | 147 | else if (this.eメニュー種別 == Eメニュー種別.DisplayDrums) |
146 | 148 | { |
147 | - t項目リストの設定(Eメニュー種別.Drums); | |
149 | + t項目リストの設定(Eメニュー種別.Drums, true ); | |
148 | 150 | } |
149 | 151 | else if (this.eメニュー種別 == Eメニュー種別.DisplayGuitar) |
150 | 152 | { |
151 | - t項目リストの設定(Eメニュー種別.Guitar); | |
153 | + t項目リストの設定(Eメニュー種別.Guitar, true ); | |
152 | 154 | } |
153 | 155 | else if (this.eメニュー種別 == Eメニュー種別.DisplayBass) |
154 | 156 | { |
155 | - t項目リストの設定(Eメニュー種別.Bass); | |
157 | + t項目リストの設定(Eメニュー種別.Bass, true ); | |
156 | 158 | } |
157 | 159 | else if (this.eメニュー種別 == Eメニュー種別.EDrumsSettings) |
158 | 160 | { |
159 | - t項目リストの設定(Eメニュー種別.Drums); | |
161 | + t項目リストの設定(Eメニュー種別.Drums, true ); | |
160 | 162 | } |
161 | 163 | else if (this.eメニュー種別 == Eメニュー種別.HitRangeSettings) |
162 | 164 | { |
163 | - t項目リストの設定(Eメニュー種別.System); | |
165 | + t項目リストの設定(Eメニュー種別.System, true ); | |
164 | 166 | } |
165 | 167 | else if ( this.eメニュー種別 == Eメニュー種別.SoundSettings) |
166 | 168 | { |
167 | - t項目リストの設定(Eメニュー種別.System); | |
169 | + t項目リストの設定(Eメニュー種別.System, true ); | |
168 | 170 | } |
169 | 171 | } |
170 | 172 |
@@ -233,8 +235,25 @@ namespace DTXMania | ||
233 | 235 | this.eメニュー種別 = Eメニュー種別.Unknown; |
234 | 236 | } |
235 | 237 | |
236 | - public void t項目リストの設定(Eメニュー種別 eMenu) | |
238 | + /// <summary> | |
239 | + /// Set item lists in the right-side screen | |
240 | + /// </summary> | |
241 | + /// <param name="eMenu">E-menu-type</param> | |
242 | + /// <param name="bExiting">whether the action is "entering menu(false)" or "exiting menu(true)"</param> | |
243 | + public void t項目リストの設定(Eメニュー種別 eMenu, bool bExiting) | |
237 | 244 | { |
245 | + | |
246 | + #region [ Push the last menu strings ] | |
247 | + if ( !bExiting && this.list項目リスト?.Count > 0 ) | |
248 | + { | |
249 | + string lastItemName = this.list項目リスト[ n現在の選択項目 ].label; | |
250 | + if ( lastItemName != null ) | |
251 | + { | |
252 | + flowHistory.Push( lastItemName ); | |
253 | + } | |
254 | + } | |
255 | + #endregion | |
256 | + | |
238 | 257 | this.list項目リスト.Clear(); |
239 | 258 | |
240 | 259 | Func<EPad, string, string, COptionString> PadNotifier = (pad, lbl, expl) => |
@@ -599,7 +618,20 @@ namespace DTXMania | ||
599 | 618 | list項目リスト.Add(KeyAssignMenu.Bass); |
600 | 619 | } |
601 | 620 | OnListMenuの初期化(); |
602 | - n現在の選択項目 = 0; | |
621 | + | |
622 | + | |
623 | + if ( bExiting ) | |
624 | + { | |
625 | + #region [ Pull the upper item name from a stack, search it from the upper item lists, then set my position to it ] | |
626 | + string lastItemName = ( flowHistory.Count <= 0 ) ? null : flowHistory.Pop(); | |
627 | + n現在の選択項目 = list項目リスト.FindIndex( s => s.label == lastItemName ); | |
628 | + if ( n現在の選択項目 < 0 ) n現在の選択項目 = 0; | |
629 | + #endregion | |
630 | + } | |
631 | + else | |
632 | + { | |
633 | + n現在の選択項目 = 0; | |
634 | + } | |
603 | 635 | eメニュー種別 = eMenu; |
604 | 636 | } |
605 | 637 |
@@ -645,6 +677,7 @@ namespace DTXMania | ||
645 | 677 | if (b活性化してない) |
646 | 678 | { |
647 | 679 | this.list項目リスト = new List<COptionBase>(); |
680 | + this.flowHistory = new Stack<string>(); | |
648 | 681 | this.eメニュー種別 = Eメニュー種別.Unknown; |
649 | 682 | |
650 | 683 | CResources cr = CDTXMania.Instance.Resources; |
@@ -677,64 +710,64 @@ namespace DTXMania | ||
677 | 710 | |
678 | 711 | DisplayMenu.Drums.OnEnterDelegate = () => |
679 | 712 | { |
680 | - t項目リストの設定(Eメニュー種別.DisplayDrums); | |
713 | + t項目リストの設定(Eメニュー種別.DisplayDrums, false); | |
681 | 714 | }; |
682 | 715 | DisplayMenu.Guitar.OnEnterDelegate = () => |
683 | 716 | { |
684 | - t項目リストの設定(Eメニュー種別.DisplayGuitar); | |
717 | + t項目リストの設定( Eメニュー種別.DisplayGuitar, false); | |
685 | 718 | }; |
686 | 719 | DisplayMenu.Bass.OnEnterDelegate = () => |
687 | 720 | { |
688 | - t項目リストの設定(Eメニュー種別.DisplayBass); | |
721 | + t項目リストの設定( Eメニュー種別.DisplayBass, false ); | |
689 | 722 | }; |
690 | 723 | DisplayMenu.System.OnEnterDelegate = () => |
691 | 724 | { |
692 | - t項目リストの設定(Eメニュー種別.DisplaySystem); | |
725 | + t項目リストの設定( Eメニュー種別.DisplaySystem, false ); | |
693 | 726 | }; |
694 | 727 | KeyAssignMenu.Drums.OnEnterDelegate = () => |
695 | 728 | { |
696 | - t項目リストの設定(Eメニュー種別.KeyAssignDrums); | |
729 | + t項目リストの設定( Eメニュー種別.KeyAssignDrums, false ); | |
697 | 730 | }; |
698 | 731 | KeyAssignMenu.Guitar.OnEnterDelegate = () => |
699 | 732 | { |
700 | - t項目リストの設定(Eメニュー種別.KeyAssignGuitar); | |
733 | + t項目リストの設定(Eメニュー種別.KeyAssignGuitar, false ); | |
701 | 734 | }; |
702 | 735 | KeyAssignMenu.Bass.OnEnterDelegate = () => |
703 | 736 | { |
704 | - t項目リストの設定(Eメニュー種別.KeyAssignBass); | |
737 | + t項目リストの設定(Eメニュー種別.KeyAssignBass, false ); | |
705 | 738 | }; |
706 | 739 | KeyAssignMenu.System.OnEnterDelegate = () => |
707 | 740 | { |
708 | - t項目リストの設定(Eメニュー種別.KeyAssignSystem); | |
741 | + t項目リストの設定(Eメニュー種別.KeyAssignSystem, false ); | |
709 | 742 | }; |
710 | 743 | |
711 | 744 | ReturnToMenu.Drums.OnEnterDelegate = () => |
712 | 745 | { |
713 | - t項目リストの設定(Eメニュー種別.Drums); | |
746 | + t項目リストの設定(Eメニュー種別.Drums, true ); | |
714 | 747 | }; |
715 | 748 | ReturnToMenu.Guitar.OnEnterDelegate = () => |
716 | 749 | { |
717 | - t項目リストの設定(Eメニュー種別.Guitar); | |
750 | + t項目リストの設定(Eメニュー種別.Guitar, true ); | |
718 | 751 | }; |
719 | 752 | ReturnToMenu.Bass.OnEnterDelegate = () => |
720 | 753 | { |
721 | - t項目リストの設定(Eメニュー種別.Bass); | |
754 | + t項目リストの設定(Eメニュー種別.Bass, true ); | |
722 | 755 | }; |
723 | 756 | ReturnToMenu.System.OnEnterDelegate = () => |
724 | 757 | { |
725 | - t項目リストの設定(Eメニュー種別.System); | |
758 | + t項目リストの設定(Eメニュー種別.System, true ); | |
726 | 759 | }; |
727 | 760 | EDrumsMenu.Drums.OnEnterDelegate = () => |
728 | 761 | { |
729 | - t項目リストの設定(Eメニュー種別.EDrumsSettings); | |
762 | + t項目リストの設定(Eメニュー種別.EDrumsSettings, false ); | |
730 | 763 | }; |
731 | 764 | HitRangeMenu.OnEnterDelegate = () => |
732 | 765 | { |
733 | - t項目リストの設定( Eメニュー種別.HitRangeSettings ); | |
766 | + t項目リストの設定( Eメニュー種別.HitRangeSettings, false ); | |
734 | 767 | }; |
735 | 768 | SoundMenu.OnEnterDelegate = () => |
736 | 769 | { |
737 | - t項目リストの設定( Eメニュー種別.SoundSettings ); | |
770 | + t項目リストの設定( Eメニュー種別.SoundSettings, false ); | |
738 | 771 | }; |
739 | 772 | |
740 | 773 | #region [ スキン選択肢と、現在選択中のスキン(index)の準備 #28195 2012.5.2 yyagi ] |
@@ -782,12 +815,12 @@ namespace DTXMania | ||
782 | 815 | this.InitialForceHighPower = CDTXMania.Instance.ConfigIni.bForceHighPowerPlan; |
783 | 816 | |
784 | 817 | // #27795 2012.3.11 yyagi; System設定の中でDrumsの設定を参照しているため、 |
785 | - this.t項目リストの設定(Eメニュー種別.Bass); | |
818 | + this.t項目リストの設定(Eメニュー種別.Bass, false ); | |
786 | 819 | // 活性化の時点でDrumsの設定も入れ込んでおかないと、System設定中に例外発生することがある。 |
787 | - this.t項目リストの設定(Eメニュー種別.Guitar); | |
788 | - this.t項目リストの設定(Eメニュー種別.Drums); | |
820 | + this.t項目リストの設定(Eメニュー種別.Guitar, false ); | |
821 | + this.t項目リストの設定(Eメニュー種別.Drums, false ); | |
789 | 822 | // 順番として、最後にSystemを持ってくること。設定一覧の初期位置がSystemのため。 |
790 | - this.t項目リストの設定(Eメニュー種別.System); | |
823 | + this.t項目リストの設定(Eメニュー種別.System, false ); | |
791 | 824 | |
792 | 825 | base.On活性化(); |
793 | 826 | } |
@@ -802,6 +835,8 @@ namespace DTXMania | ||
802 | 835 | this.ct三角矢印アニメ = null; |
803 | 836 | |
804 | 837 | OnListMenuの解放(); |
838 | + flowHistory.Clear(); | |
839 | + flowHistory = null; | |
805 | 840 | prvFont.Dispose(); |
806 | 841 | |
807 | 842 | base.On非活性化(); |
@@ -550,19 +550,19 @@ namespace DTXMania | ||
550 | 550 | switch (this.n現在のメニュー番号) |
551 | 551 | { |
552 | 552 | case 0: |
553 | - this.actList.t項目リストの設定(CActConfigList.Eメニュー種別.System); | |
553 | + this.actList.t項目リストの設定(CActConfigList.Eメニュー種別.System, false ); | |
554 | 554 | break; |
555 | 555 | |
556 | 556 | case 1: |
557 | - this.actList.t項目リストの設定(CActConfigList.Eメニュー種別.Drums); | |
557 | + this.actList.t項目リストの設定(CActConfigList.Eメニュー種別.Drums, false ); | |
558 | 558 | break; |
559 | 559 | |
560 | 560 | case 2: |
561 | - this.actList.t項目リストの設定(CActConfigList.Eメニュー種別.Guitar); | |
561 | + this.actList.t項目リストの設定(CActConfigList.Eメニュー種別.Guitar, false ); | |
562 | 562 | break; |
563 | 563 | |
564 | 564 | case 3: |
565 | - this.actList.t項目リストの設定(CActConfigList.Eメニュー種別.Bass); | |
565 | + this.actList.t項目リストの設定(CActConfigList.Eメニュー種別.Bass, false ); | |
566 | 566 | break; |
567 | 567 | |
568 | 568 | case 4: |
@@ -595,19 +595,19 @@ namespace DTXMania | ||
595 | 595 | switch (this.n現在のメニュー番号) |
596 | 596 | { |
597 | 597 | case 0: |
598 | - this.actList.t項目リストの設定(CActConfigList.Eメニュー種別.System); | |
598 | + this.actList.t項目リストの設定(CActConfigList.Eメニュー種別.System, false ); | |
599 | 599 | break; |
600 | 600 | |
601 | 601 | case 1: |
602 | - this.actList.t項目リストの設定(CActConfigList.Eメニュー種別.Drums); | |
602 | + this.actList.t項目リストの設定(CActConfigList.Eメニュー種別.Drums, false ); | |
603 | 603 | break; |
604 | 604 | |
605 | 605 | case 2: |
606 | - this.actList.t項目リストの設定(CActConfigList.Eメニュー種別.Guitar); | |
606 | + this.actList.t項目リストの設定(CActConfigList.Eメニュー種別.Guitar, false ); | |
607 | 607 | break; |
608 | 608 | |
609 | 609 | case 3: |
610 | - this.actList.t項目リストの設定(CActConfigList.Eメニュー種別.Bass); | |
610 | + this.actList.t項目リストの設定(CActConfigList.Eメニュー種別.Bass, false ); | |
611 | 611 | break; |
612 | 612 | |
613 | 613 | case 4: |