2 using System.Collections.Generic;
5 using SharpDX.Direct3D9;
7 using DTXMania.Coordinates;
11 internal class CActオプションパネル : CActivity
13 public STDGBSValue<CXY> Pos;
15 EOptionPanelDirection direction;
18 readonly Point[] ptDark = new Point[] { new Point(1, 0), new Point(1, 1), new Point(1, 7) };
20 /// Off, Hid, Sud, HidSud, SInv, FInv
22 readonly Point[] ptSudHidInv = new Point[] { new Point( 0, 0 ), new Point( 0, 2 ), new Point( 0, 1 ), new Point( 0, 3 ), new Point( 4, 7 ), new Point( 5, 7 ) };
23 readonly Point[] ptLight = new Point[] { new Point(5, 4), new Point(5, 5) };
24 readonly Point[] ptRandom = new Point[] { new Point(3, 4), new Point(3, 5), new Point(3, 6), new Point(3, 7) };
25 readonly Point[] ptReverse = new Point[] { new Point(1, 2), new Point(1, 3) };
26 readonly Point[] ptTight = new Point[] { new Point(4, 4), new Point(4, 5) };
27 readonly Point[] ptScrollSpeed = new Point[]
29 new Point(2, 0), new Point(2, 1), new Point(2, 2), new Point(2, 3),
30 new Point(3, 0), new Point(3, 1), new Point(3, 2), new Point(3, 3),
31 new Point(4, 0), new Point(4, 1), new Point(4, 2), new Point(4, 3),
32 new Point(5, 0), new Point(5, 1), new Point(5, 2), new Point(5, 3)
35 private CTexture txオプションパネル;
37 public CActオプションパネル(EOptionPanelDirection dir)
40 rect = new Rectangle();
43 public override void On非活性化()
47 TextureFactory.tテクスチャの解放(ref this.txオプションパネル);
52 public override void OnManagedリソースの作成()
56 this.txオプションパネル = TextureFactory.tテクスチャの生成(CSkin.Path(@"Graphics\Screen option panels.png"), false);
57 base.OnManagedリソースの作成();
61 public override void OnManagedリソースの解放()
65 TextureFactory.tテクスチャの解放(ref txオプションパネル);
66 base.OnManagedリソースの解放();
70 private void IncrementXY(ref int x, ref int y)
72 if (direction == EOptionPanelDirection.Horizontal)
76 else if (direction == EOptionPanelDirection.Vertical)
82 private void DrawOption(int idx, Point[] pts, int x, int y)
84 if (idx >= pts.Length)
93 rect.X = p.X * rect.Width;
94 rect.Y = p.Y * rect.Height;
95 txオプションパネル.t2D描画(CDTXMania.Instance.Device, x, y, rect);
98 public override int On進行描画()
102 if (this.txオプションパネル != null)
105 for (EPart part = EPart.Drums; part <= EPart.Bass; ++part)
107 if ( CDTXMania.Instance.ConfigIni.b楽器有効(part) &&
109 (CDTXMania.Instance.r現在のステージ == CDTXMania.Instance.stage演奏画面 &&
110 CDTXMania.Instance.DTX != null && CDTXMania.Instance.DTX.bチップがある[part]) ||
111 CDTXMania.Instance.r現在のステージ != CDTXMania.Instance.stage演奏画面
118 rect.Width = CDTXMania.Instance.Coordinates.ImgOptionPanel.W;
119 rect.Height = CDTXMania.Instance.Coordinates.ImgOptionPanel.H;
122 DrawOption((int)CDTXMania.Instance.ConfigIni.eDark.Value, ptDark, x, y);
123 IncrementXY(ref x, ref y);
126 DrawOption(CDTXMania.Instance.ConfigIni.nScrollSpeed[part] - 1, ptScrollSpeed, x, y);
127 IncrementXY(ref x, ref y);
130 DrawOption((int)CDTXMania.Instance.ConfigIni.eSudHidInv[part].Value, ptSudHidInv, x, y);
131 IncrementXY(ref x, ref y);
134 DrawOption(CDTXMania.Instance.ConfigIni.bReverse[part] ? 1 : 0, ptReverse, x, y);
135 IncrementXY(ref x, ref y);
137 if (part == EPart.Drums)
140 DrawOption(CDTXMania.Instance.ConfigIni.bTight ? 1 : 0, ptTight, x, y);
141 IncrementXY(ref x, ref y);
144 if (part == EPart.Guitar || part == EPart.Bass)
147 DrawOption((int)CDTXMania.Instance.ConfigIni.eRandom[part].Value, ptRandom, x, y);
148 IncrementXY(ref x, ref y);
151 DrawOption(CDTXMania.Instance.ConfigIni.bLight[part].Value ? 1 : 0, ptLight, x, y);
152 IncrementXY(ref x, ref y);