OSDN Git Service

#32713 初コミット。SVNrev567時点での、ファイルはbranch/140707(ReBuild XGVersion)から移行したもの。
[dtxmaniaxg-verk/dtxmaniaxg-verk-git.git] / DTXManiaプロジェクト / コード / ステージ / 05.選曲 / CActSortSongs.cs
1 using System;
2 using System.Collections.Generic;
3 using System.Diagnostics;
4 using System.Text;
5
6 namespace DTXMania
7 {
8         internal class CActSortSongs : CActSelectPopupMenu
9         {
10
11                 // コンストラクタ
12
13                 public CActSortSongs()
14                 {
15                         List<CItemBase> lci = new List<CItemBase>();
16                         lci.Add( new CItemList( "Title",                CItemBase.Eパネル種別.通常, 0, "", "", new string[] { "Z,Y,X,...",               "A,B,C,..." } ) );
17                         lci.Add( new CItemList( "Level",                CItemBase.Eパネル種別.通常, 0, "", "", new string[] { "99,98,97,...",    "1,2,3,..." } ) );
18                         lci.Add( new CItemList( "Best Rank",    CItemBase.Eパネル種別.通常, 0, "", "", new string[] { "E,D,C,...",               "SS,S,A,..." } ) );
19                         lci.Add( new CItemList( "PlayCount",    CItemBase.Eパネル種別.通常, 0, "", "", new string[] { "10,9,8,...",              "1,2,3,..." } ) );
20                         lci.Add( new CItemList( "Author",               CItemBase.Eパネル種別.通常, 0, "", "", new string[] { "Z,Y,X,...",               "A,B,C,..." } ) );
21                         lci.Add( new CItemList( "SkillPoint",   CItemBase.Eパネル種別.通常, 0, "", "", new string[] { "100,99,98,...",   "1,2,3,..." } ) );
22 #if TEST_SORTBGM
23                         lci.Add( new CItemList( "BPM",                  CItemBase.Eパネル種別.通常, 0, "", "", new string[] { "300,200,...",     "70,80,90,..." } ) );
24 #endif
25                         lci.Add( new CItemList( "Date",                 CItemBase.Eパネル種別.通常, 0, "", "", new string[] { "Dec.31,30,...",   "Jan.1,2,..." } ) );
26                         lci.Add( new CItemList( "Return",               CItemBase.Eパネル種別.通常, 0, "", "", new string[] { "",                                "" } ) );
27                         
28                         base.Initialize( lci, false, "SORT MENU" );
29                 }
30
31
32                 // メソッド
33                 public void tActivatePopupMenu( E楽器パート einst, ref CActSelect曲リスト ca )
34                 {
35                     this.act曲リスト = ca;
36                         base.tActivatePopupMenu( einst );
37                 }
38                 //public void tDeativatePopupMenu()
39                 //{
40                 //      base.tDeativatePopupMenu();
41                 //}
42
43
44                 public override void tEnter押下Main( int nSortOrder )
45                 {
46                         nSortOrder *= 2;        // 0,1  => -1, 1
47                         nSortOrder -= 1;
48                         switch ( n現在の選択行 )
49                         {
50                                 case (int) EOrder.Title:
51                                         this.act曲リスト.t曲リストのソート(
52                                                 CDTXMania.Songs管理.t曲リストのソート2_タイトル順, eInst, nSortOrder
53                                         );
54                                         this.act曲リスト.t選択曲が変更された(true);
55                                         break;
56                                 case (int) EOrder.Level:
57                                         this.act曲リスト.t曲リストのソート(
58                                                 CDTXMania.Songs管理.t曲リストのソート4_LEVEL順, eInst, nSortOrder,
59                                                 this.act曲リスト.n現在のアンカ難易度レベル
60                                         );
61                                         this.act曲リスト.t選択曲が変更された( true );
62                                         break;
63                                 case (int) EOrder.BestRank:
64                                         this.act曲リスト.t曲リストのソート(
65                                                 CDTXMania.Songs管理.t曲リストのソート5_BestRank順, eInst, nSortOrder,
66                                                 this.act曲リスト.n現在のアンカ難易度レベル
67                                         );
68                                         break;
69                                 case (int) EOrder.PlayCount:
70                                         // this.act曲リスト.t曲リストのソート3_演奏回数の多い順( eInst, nSortOrder );
71                                         this.act曲リスト.t曲リストのソート(
72                                                 CDTXMania.Songs管理.t曲リストのソート3_演奏回数の多い順, eInst, nSortOrder,
73                                                 this.act曲リスト.n現在のアンカ難易度レベル
74                                         );
75                                         this.act曲リスト.t選択曲が変更された( true );
76                                         break;
77                                 case (int) EOrder.Author:
78                                         this.act曲リスト.t曲リストのソート(
79                                                 CDTXMania.Songs管理.t曲リストのソート8_アーティスト名順, eInst, nSortOrder,
80                                                 this.act曲リスト.n現在のアンカ難易度レベル
81                                         );
82                                         this.act曲リスト.t選択曲が変更された( true );
83                                         break;
84                                 case (int) EOrder.SkillPoint:
85                                         this.act曲リスト.t曲リストのソート(
86                                                 CDTXMania.Songs管理.t曲リストのソート6_SkillPoint順, eInst, nSortOrder,
87                                                 this.act曲リスト.n現在のアンカ難易度レベル
88                                         );
89                                         this.act曲リスト.t選択曲が変更された( true );
90                                         break;
91 #if TEST_SORTBGM
92                                                 case (int) ESortItem.BPM:
93                                                 this.act曲リスト.t曲リストのソート(
94                                                         CDTXMania.Songs管理.t曲リストのソート9_BPM順, eInst, nSortOrder,
95                                                         this.act曲リスト.n現在のアンカ難易度レベル
96                                                 );
97                                         this.act曲リスト.t選択曲が変更された(true);
98                                                 break;
99 #endif
100                                 case (int) EOrder.Date:
101                                         this.act曲リスト.t曲リストのソート(
102                                                 CDTXMania.Songs管理.t曲リストのソート7_更新日時順, eInst, nSortOrder,
103                                                 this.act曲リスト.n現在のアンカ難易度レベル
104                                         );
105                                         this.act曲リスト.t選択曲が変更された( true );
106                                         break;
107                                 case (int) EOrder.Return:
108                                         this.tDeativatePopupMenu();
109                                         break;
110                                 default:
111                                         break;
112                         }
113                 }
114                 
115                 // CActivity 実装
116
117                 public override void On活性化()
118                 {
119                         base.On活性化();
120                 }
121                 public override void On非活性化()
122                 {
123                         if( !base.b活性化してない )
124                         {
125                                 base.On非活性化();
126                         }
127                 }
128                 public override void OnManagedリソースの作成()
129                 {
130                         if( !base.b活性化してない )
131                         {
132                                 base.OnManagedリソースの作成();
133                         }
134                 }
135                 public override void OnManagedリソースの解放()
136                 {
137                         base.OnManagedリソースの解放();
138                 }
139
140                 #region [ private ]
141                 //-----------------
142
143                 private CActSelect曲リスト act曲リスト;
144
145                 private enum EOrder : int
146                 {
147                         Title = 0, Level, BestRank, PlayCount,
148                         Author,
149                         SkillPoint,
150 #if TEST_SORTBGM
151                         BPM,
152 #endif
153                         Date,
154                         Return, END,
155                         Default = 99
156                 };
157                 //-----------------
158                 #endregion
159         }
160
161
162 }