• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-ccocoa誰得qtrubybathyscaphegamewindowspythonphpguic翻訳omegattwitterframeworkbtronarduinovb.net計画中(planning stage)directxpreviewertestゲームエンジンdom

dtxmania 中文


Commit MetaInfo

Revision10b7316747dede4a08513295c3e893f077f1e789 (tree)
Zeit2020-01-08 02:34:51
Autoryyagi <yyagi.dtxmania@gmai...>
Commiteryyagi

Log Message

#39816 Fixed below. (Basically I had to backup/restore QAuto.Index value when changing Target (Drums/Guitar/Bass)).

  • Changing Drum Auto also changes the Auto for Guitar and vice versa.
  • Changing Bass Auto does not change anything.
  • The text is missing from the menu.
  • "Auto BD" for Drum sets Auto to SD

BTW current code has many debug code. Refactor will be required.

Ändern Zusammenfassung

  • delete: "DTXMania/\343\202\263\343\203\274\343\203\211/\343\202\271\343\203\206\343\203\274\343\202\270/05.\351\201\270\346\233\262/CActSelectQuickConfig.cs"

Diff

--- "a/DTXMania/\343\202\263\343\203\274\343\203\211/\343\202\271\343\203\206\343\203\274\343\202\270/05.\351\201\270\346\233\262/CActSelectQuickConfig.cs"
+++ "b/DTXMania/\343\202\263\343\203\274\343\203\211/\343\202\271\343\203\206\343\203\274\343\202\270/05.\351\201\270\346\233\262/CActSelectQuickConfig.cs"
@@ -14,6 +14,7 @@ namespace DTXMania
1414 readonly string QuickCfgTitle = "Quick Config";
1515 COptionStringList QTarget;
1616 COptionStringList QAuto;
17+ STDGBSValue<int> QAutoIndex; //QAuto.Indexの保持用
1718 List<COptionBase> lci;
1819 Font ft表示用フォント;
1920 CTexture txパネル本体;
@@ -40,6 +41,7 @@ namespace DTXMania
4041 •More...
4142 •EXIT
4243 */
44+ QAuto = new COptionStringList("Custom"); // 以前はMakeListCItemBase()で初期化していたが、QAuto.Indexの保持のため、より上位で初期化するように変更
4345 QTarget = new COptionStringList("Drums");
4446 QTarget.Initialize("Target", "", new string[] { "Drums", "Guitar", "Bass" });
4547 QTarget.OnEnterDelegate = () =>
@@ -47,54 +49,84 @@ namespace DTXMania
4749 EPart nCurrentTarget = 0;
4850 if (QTarget.Index == 0)
4951 {
52+ QAutoIndex.Bass = QAuto.Index;
53+Trace.TraceInformation("QAutoIndex.Bass=" + QAutoIndex.Bass);
54+ QAuto.Index = QAutoIndex.Drums;
55+Trace.TraceInformation("QAuto,Index=" + QAuto.Index);
5056 nCurrentTarget = EPart.Drums;
5157 }
5258 else if (QTarget.Index == 1)
5359 {
60+ QAutoIndex.Drums = QAuto.Index;
61+Trace.TraceInformation("QAutoIndex.Drums=" + QAutoIndex.Drums);
62+ QAuto.Index = QAutoIndex.Guitar;
63+Trace.TraceInformation("QAuto,Index=" + QAuto.Index);
5464 nCurrentTarget = EPart.Guitar;
5565 }
5666 else if (QTarget.Index == 2)
5767 {
68+ QAutoIndex.Guitar = QAuto.Index;
69+Trace.TraceInformation("QAutoIndex.Guitar=" + QAutoIndex.Guitar);
70+ QAuto.Index = QAutoIndex.Bass;
71+Trace.TraceInformation("QAuto,Index=" + QAuto.Index);
5872 nCurrentTarget = EPart.Bass;
5973 }
60- lci = MakeListCItemBase(nCurrentTarget);
74+ lci = MakeListCItemBase(nCurrentTarget, false); // false: QAuto.Indexを初期化しない
75+Trace.TraceInformation("AQAuto.Index=" + QAuto.Index);
6176 // eInst = (E楽器パート) nCurrentTarget;
6277 // ここではeInstは変えない。メニューを開いたタイミングでのみeInstを使う
6378 Initialize(lci, true, QuickCfgTitle, n現在の選択行);
79+Trace.TraceInformation("BQAuto.Index=" + QAuto.Index);
6480 MakeAutoPanel();
81+Trace.TraceInformation("CQAuto.Index=" + QAuto.Index);
6582 };
6683 lci = MakeListCItemBase(EPart.Drums);
6784 // ConfSet=0, nInst=Drums
6885 base.Initialize(lci, true, QuickCfgTitle, 2);
86+ QAutoIndex = new STDGBSValue<int>(); // Drums, Guitar, Bass
87+ QAutoIndex.Drums = GetAutoIndex(EPart.Drums);
88+ QAutoIndex.Guitar = GetAutoIndex(EPart.Guitar);
89+ QAutoIndex.Bass = GetAutoIndex(EPart.Bass);
90+Trace.TraceInformation($"★ {QAutoIndex.Drums}, {QAutoIndex.Guitar}, {QAutoIndex.Bass}");
6991 }
7092
71- private List<COptionBase> MakeListCItemBase(EPart nInst)
93+ private List<COptionBase> MakeListCItemBase(EPart nInst, bool bInitQAutoIndex = true)
7294 {
7395 List<COptionBase> ret = new List<COptionBase>();
7496
75- QAuto = new COptionStringList("Custom");
97+ //QAuto = new COptionStringList("Custom");
7698 if (nInst == EPart.Drums)
7799 {
78100 string[] items_dr = new string[] { "All On", "Auto HH", "Auto BD", "Custom", "All Off" };
79- int dr_init_idx = 3;
80- if (CDTXMania.Instance.ConfigIni.bAutoPlay.IsAllTrue(EPart.Drums))
81- {
82- dr_init_idx = 0; // All On
83- }
84- else if (CDTXMania.Instance.ConfigIni.bAutoPlay.bIsAutoHH)
85- {
86- dr_init_idx = 1; // Auto HH
87- }
88- else if (CDTXMania.Instance.ConfigIni.bAutoPlay.bIsAutoBD)
101+ //int dr_init_idx = 3;
102+ //if (CDTXMania.Instance.ConfigIni.bAutoPlay.IsAllTrue(EPart.Drums))
103+ //{
104+ // dr_init_idx = 0; // All On
105+ //}
106+ //else if (CDTXMania.Instance.ConfigIni.bAutoPlay.bIsAutoHH)
107+ //{
108+ // dr_init_idx = 1; // Auto HH
109+ //}
110+ //else if (CDTXMania.Instance.ConfigIni.bAutoPlay.bIsAutoBD)
111+ //{
112+ // dr_init_idx = 2; // Auto BD
113+ //}
114+ //else if (CDTXMania.Instance.ConfigIni.bAutoPlay.IsAllFalse(EPart.Drums))
115+ //{
116+ // dr_init_idx = 4; // All Off
117+ //}
118+Trace.TraceInformation("1QAuto.Index=" + QAuto.Index);
119+ QAuto.Initialize("Auto", "", items_dr);
120+Trace.TraceInformation("xQAuto.Index=" + QAuto.Index);
121+ if (bInitQAutoIndex)
89122 {
90- dr_init_idx = 2; // Auto BD
123+ QAuto.Index = GetAutoIndex(nInst); //dr_init_idx;
91124 }
92- else if (CDTXMania.Instance.ConfigIni.bAutoPlay.IsAllFalse(EPart.Drums))
125+ else
93126 {
94- dr_init_idx = 4; // All Off
127+ QAuto.Index = QAutoIndex.Drums; // QAuto.Initialize()でIndexが初期化されるため、再設定する
95128 }
96- QAuto.Initialize("Auto", "", items_dr);
97- QAuto.Index = dr_init_idx;
129+Trace.TraceInformation("2QAuto.Index=" + QAuto.Index);
98130 QAuto.OnEnterDelegate = () =>
99131 {
100132 //if (QAuto.Value == "All On")
@@ -120,25 +152,31 @@ namespace DTXMania
120152 {
121153 string[] items_gt = new string[] { "All On", "Auto Pick", "Auto Neck", "Custom", "All Off" };
122154 // 初期値の決定
123- int gt_init_idx = 3;
124- if (CDTXMania.Instance.ConfigIni.bAutoPlay.IsAllTrue(nInst))
125- {
126- gt_init_idx = 0;
127- }
128- else if (CDTXMania.Instance.ConfigIni.bAutoPlay.bIsAutoPick(nInst))
129- {
130- gt_init_idx = 1;
131- }
132- else if (CDTXMania.Instance.ConfigIni.bAutoPlay.bIsAutoNeck(nInst))
155+ //int gt_init_idx = 3;
156+ //if (CDTXMania.Instance.ConfigIni.bAutoPlay.IsAllTrue(nInst))
157+ //{
158+ // gt_init_idx = 0;
159+ //}
160+ //else if (CDTXMania.Instance.ConfigIni.bAutoPlay.bIsAutoPick(nInst))
161+ //{
162+ // gt_init_idx = 1;
163+ //}
164+ //else if (CDTXMania.Instance.ConfigIni.bAutoPlay.bIsAutoNeck(nInst))
165+ //{
166+ // gt_init_idx = 2;
167+ //}
168+ //else if (CDTXMania.Instance.ConfigIni.bAutoPlay.IsAllFalse(nInst))
169+ //{
170+ // gt_init_idx = 4;
171+ //}
172+ QAuto.Initialize("Auto", "", items_gt);
173+ if (bInitQAutoIndex)
133174 {
134- gt_init_idx = 2;
175+ QAuto.Index = GetAutoIndex(nInst); //gt_init_idx;
135176 }
136- else if (CDTXMania.Instance.ConfigIni.bAutoPlay.IsAllFalse(nInst))
137177 {
138- gt_init_idx = 4;
178+ QAuto.Index = QAutoIndex[nInst]; // QAuto.Initialize()でIndexが初期化されるため、再設定する
139179 }
140- QAuto.Initialize("Auto", "", items_gt);
141- QAuto.Index = gt_init_idx;
142180 QAuto.OnEnterDelegate = () =>
143181 {
144182 //if (QAuto.Value == "All On")
@@ -195,16 +233,80 @@ namespace DTXMania
195233 return ret;
196234 }
197235
236+ /// <summary>
237+ /// 現在のAuto設定状況から、AutoのIndex値を生成する (Auto HH? Auto BD? Auto Pick? ....)
238+ /// ただし設定済みのAuto設定状況を使用するので注意。Auto項目をEnterで切り替えるだけではAuto設定は変化しない。
239+ /// (Auto=Customの状態保持のために、そうしている)
240+ /// </summary>
241+ /// <param name="nInst"></param>
242+ /// <returns></returns>
243+ private int GetAutoIndex(EPart nInst)
244+ {
245+ int init_idx = 3;
246+ if (nInst == EPart.Drums)
247+ {
248+ // 初期値の決定
249+ if (CDTXMania.Instance.ConfigIni.bAutoPlay.IsAllTrue(EPart.Drums))
250+ {
251+ init_idx = 0; // All On
252+ }
253+ else if (CDTXMania.Instance.ConfigIni.bAutoPlay.bIsAutoHH)
254+ {
255+ init_idx = 1; // Auto HH
256+ }
257+ else if (CDTXMania.Instance.ConfigIni.bAutoPlay.bIsAutoBD)
258+ {
259+ init_idx = 2; // Auto BD
260+ }
261+ else if (CDTXMania.Instance.ConfigIni.bAutoPlay.IsAllFalse(EPart.Drums))
262+ {
263+ init_idx = 4; // All Off
264+ }
265+Trace.TraceInformation("GetAutoIndex: Drums: " + init_idx);
266+ }
267+ else if (nInst == EPart.Guitar || nInst == EPart.Bass)
268+ {
269+ // 初期値の決定
270+ if (CDTXMania.Instance.ConfigIni.bAutoPlay.IsAllTrue(nInst))
271+ {
272+ init_idx = 0; // All On
273+ }
274+ else if (CDTXMania.Instance.ConfigIni.bAutoPlay.bIsAutoPick(nInst))
275+ {
276+ init_idx = 1; // Auto Pick
277+ }
278+ else if (CDTXMania.Instance.ConfigIni.bAutoPlay.bIsAutoNeck(nInst))
279+ {
280+ init_idx = 2; // Auto Neck
281+ }
282+ else if (CDTXMania.Instance.ConfigIni.bAutoPlay.IsAllFalse(nInst))
283+ {
284+ init_idx = 4; // All Off
285+ }
286+Trace.TraceInformation("GetAutoIndex: GtBs: " + init_idx);
287+ }
288+ else
289+ {
290+ throw new ArgumentOutOfRangeException();
291+ }
292+ return init_idx;
293+ }
294+
295+
198296 // メソッド
199297 public override void tActivatePopupMenu(EPart einst)
200298 {
299+ // Activateすると、DrumsのAutoIndexだけ化けているので、Instance.Configiniから再取得する
300+ //QAutoIndex.Drums = GetAutoIndex(EPart.Drums);
301+ //QAutoIndex.Guitar = GetAutoIndex(EPart.Guitar);
302+ //QAutoIndex.Bass = GetAutoIndex(EPart.Bass);
303+
201304 this.CActSelectQuickConfigMain();
202305 base.tActivatePopupMenu(einst);
203306 }
204307
205308 /// <summary>
206309 /// Auto Modeにフォーカスを合わせているときだけ、AUTOの設定状態を表示する。
207- /// 現状はDrumでのみ表示。
208310 /// </summary>
209311 public override void t進行描画sub()
210312 {
@@ -309,21 +411,21 @@ namespace DTXMania
309411 {
310412 if (this.tx文字列パネル != null)
311413 {
312- this.tx文字列パネル.Dispose();
414+ TextureFactory.tテクスチャの解放(ref this.tx文字列パネル);
313415 }
314- this.tx文字列パネル = new CTexture(CDTXMania.Instance.Device, image, CDTXMania.Instance.TextureFormat);
416+ this.tx文字列パネル = new CTexture(CDTXMania.Instance.Device, image, CDTXMania.Instance.TextureFormat, "AutoStrings");
315417 this.tx文字列パネル.vc拡大縮小倍率 = new Vector3(1f, 1f, 1f);
316418 image.Dispose();
317419 }
318420 catch (CTextureCreateFailedException)
319421 {
320- Trace.TraceError("演奏履歴文字列テクスチャの作成に失敗しました。");
422+ Trace.TraceError("Quick Config: Autoパネルテクスチャの作成に失敗しました。");
321423 this.tx文字列パネル = null;
322424 }
323425 }
324426
325427 /// <summary>
326- /// 簡易CONFIG内のAUTO状態を、文字列で返す。
428+ /// 簡易CONFIG内のAUTO状態を、文字列で返す。(AAA___など)
327429 /// </summary>
328430 /// <param name="target">対象楽器</param>
329431 /// <returns>AutoならA,さもなくば_。この文字が複数並んだ文字列。</returns>
@@ -343,10 +445,10 @@ namespace DTXMania
343445 s = "_AA_______";
344446 break;
345447 case 2: // Auto BD
346- s = "___A______";
448+ s = "____A_____";
347449 break;
348450 case 3: // Custom
349- // 本当は、現在のレーン順に合わせた表示順にしたいが・・・
451+ // 本当は、現在のレーン順に合わせた表示順にしたいが・・・
350452 COptionBool[] e = new[] {
351453 CDTXMania.Instance.ConfigIni.bAutoPlay.LC,
352454 CDTXMania.Instance.ConfigIni.bAutoPlay.HH,
@@ -410,42 +512,55 @@ namespace DTXMania
410512 return s;
411513 }
412514
515+
413516 /// <summary>
414517 /// ConfigIni.bAutoPlayに簡易CONFIGの状態を反映する
415518 /// </summary>
416- private void SetAutoParameters()
519+ private void SetAutoParameters(EPart nInst)
417520 {
418521 string s;
419522 #region [Drums]
420- s = GetAutoParameters(EPart.Drums);
421- CDTXMania.Instance.ConfigIni.bAutoPlay.LC.Value = (s[0] == 'A'); s = s.Remove(0, 1);
422- CDTXMania.Instance.ConfigIni.bAutoPlay.HH.Value = (s[0] == 'A'); s = s.Remove(0, 1);
423- CDTXMania.Instance.ConfigIni.bAutoPlay.HHO.Value = (s[0] == 'A'); s = s.Remove(0, 1);
424- CDTXMania.Instance.ConfigIni.bAutoPlay.SD.Value = (s[0] == 'A'); s = s.Remove(0, 1);
425- CDTXMania.Instance.ConfigIni.bAutoPlay.BD.Value = (s[0] == 'A'); s = s.Remove(0, 1);
426- CDTXMania.Instance.ConfigIni.bAutoPlay.HT.Value = (s[0] == 'A'); s = s.Remove(0, 1);
427- CDTXMania.Instance.ConfigIni.bAutoPlay.LT.Value = (s[0] == 'A'); s = s.Remove(0, 1);
428- CDTXMania.Instance.ConfigIni.bAutoPlay.FT.Value = (s[0] == 'A'); s = s.Remove(0, 1);
429- CDTXMania.Instance.ConfigIni.bAutoPlay.CY.Value = (s[0] == 'A'); s = s.Remove(0, 1);
430- CDTXMania.Instance.ConfigIni.bAutoPlay.RD.Value = (s[0] == 'A'); s = s.Remove(0, 1);
523+ if (nInst == EPart.Drums)
524+ {
525+ s = GetAutoParameters(EPart.Drums);
526+ CDTXMania.Instance.ConfigIni.bAutoPlay.LC.Value = (s[0] == 'A'); s = s.Remove(0, 1);
527+ CDTXMania.Instance.ConfigIni.bAutoPlay.HH.Value = (s[0] == 'A'); s = s.Remove(0, 1);
528+ CDTXMania.Instance.ConfigIni.bAutoPlay.HHO.Value = (s[0] == 'A'); s = s.Remove(0, 1);
529+ CDTXMania.Instance.ConfigIni.bAutoPlay.SD.Value = (s[0] == 'A'); s = s.Remove(0, 1);
530+ CDTXMania.Instance.ConfigIni.bAutoPlay.BD.Value = (s[0] == 'A'); s = s.Remove(0, 1);
531+ CDTXMania.Instance.ConfigIni.bAutoPlay.HT.Value = (s[0] == 'A'); s = s.Remove(0, 1);
532+ CDTXMania.Instance.ConfigIni.bAutoPlay.LT.Value = (s[0] == 'A'); s = s.Remove(0, 1);
533+ CDTXMania.Instance.ConfigIni.bAutoPlay.FT.Value = (s[0] == 'A'); s = s.Remove(0, 1);
534+ CDTXMania.Instance.ConfigIni.bAutoPlay.CY.Value = (s[0] == 'A'); s = s.Remove(0, 1);
535+ CDTXMania.Instance.ConfigIni.bAutoPlay.RD.Value = (s[0] == 'A'); //s = s.Remove(0, 1);
536+ }
431537 #endregion
432538 #region [Guitar]
433- s = GetAutoParameters(EPart.Guitar);
434- CDTXMania.Instance.ConfigIni.bAutoPlay.GtR.Value = (s[0] == 'A'); s = s.Remove(0, 1);
435- CDTXMania.Instance.ConfigIni.bAutoPlay.GtG.Value = (s[0] == 'A'); s = s.Remove(0, 1);
436- CDTXMania.Instance.ConfigIni.bAutoPlay.GtB.Value = (s[0] == 'A'); s = s.Remove(0, 1);
437- CDTXMania.Instance.ConfigIni.bAutoPlay.GtPick.Value = (s[0] == 'A'); s = s.Remove(0, 1);
438- CDTXMania.Instance.ConfigIni.bAutoPlay.GtWail.Value = (s[0] == 'A'); s = s.Remove(0, 1);
539+ else if (nInst == EPart.Guitar)
540+ {
541+ s = GetAutoParameters(EPart.Guitar);
542+ CDTXMania.Instance.ConfigIni.bAutoPlay.GtR.Value = (s[0] == 'A'); s = s.Remove(0, 1);
543+ CDTXMania.Instance.ConfigIni.bAutoPlay.GtG.Value = (s[0] == 'A'); s = s.Remove(0, 1);
544+ CDTXMania.Instance.ConfigIni.bAutoPlay.GtB.Value = (s[0] == 'A'); s = s.Remove(0, 1);
545+ CDTXMania.Instance.ConfigIni.bAutoPlay.GtPick.Value = (s[0] == 'A'); s = s.Remove(0, 1);
546+ CDTXMania.Instance.ConfigIni.bAutoPlay.GtWail.Value = (s[0] == 'A'); //s = s.Remove(0, 1);
547+ }
439548 #endregion
440549 #region [Bass]
441- s = GetAutoParameters(EPart.Bass);
442- CDTXMania.Instance.ConfigIni.bAutoPlay.GtR.Value = (s[0] == 'A'); s = s.Remove(0, 1);
443- CDTXMania.Instance.ConfigIni.bAutoPlay.GtG.Value = (s[0] == 'A'); s = s.Remove(0, 1);
444- CDTXMania.Instance.ConfigIni.bAutoPlay.GtB.Value = (s[0] == 'A'); s = s.Remove(0, 1);
445- CDTXMania.Instance.ConfigIni.bAutoPlay.GtPick.Value = (s[0] == 'A'); s = s.Remove(0, 1);
446- CDTXMania.Instance.ConfigIni.bAutoPlay.GtWail.Value = (s[0] == 'A'); s = s.Remove(0, 1);
550+ else if (nInst == EPart.Bass)
551+ {
552+ s = GetAutoParameters(EPart.Bass);
553+ CDTXMania.Instance.ConfigIni.bAutoPlay.BsR.Value = (s[0] == 'A'); s = s.Remove(0, 1);
554+ CDTXMania.Instance.ConfigIni.bAutoPlay.BsG.Value = (s[0] == 'A'); s = s.Remove(0, 1);
555+ CDTXMania.Instance.ConfigIni.bAutoPlay.BsB.Value = (s[0] == 'A'); s = s.Remove(0, 1);
556+ CDTXMania.Instance.ConfigIni.bAutoPlay.BsPick.Value = (s[0] == 'A'); s = s.Remove(0, 1);
557+ CDTXMania.Instance.ConfigIni.bAutoPlay.BsWail.Value = (s[0] == 'A'); //s = s.Remove(0, 1);
558+ }
447559 #endregion
448-
560+ else
561+ {
562+ throw new ArgumentOutOfRangeException();
563+ }
449564 //for (EPart target = EPart.Guitar; target < EPart.Bass; target++)
450565 //{
451566 // s += GetAutoParameters(target);
@@ -458,6 +573,19 @@ namespace DTXMania
458573 // CDTXMania.Instance.ConfigIni.bAutoPlay[i].Value = (s[j++] == 'A') ? true : false;
459574 //}
460575 }
576+ private void SetAutoParameters()
577+ {
578+ QAutoIndex[(EPart)(QTarget.Index)] = QAuto.Index;
579+
580+ QAuto.Index = QAutoIndex[EPart.Drums];
581+ SetAutoParameters(EPart.Drums);
582+ QAuto.Index = QAutoIndex[EPart.Guitar];
583+ SetAutoParameters(EPart.Guitar);
584+ QAuto.Index = QAutoIndex[EPart.Bass];
585+ SetAutoParameters(EPart.Bass);
586+ }
587+
588+
461589
462590 // CActivity 実装
463591
@@ -491,6 +619,10 @@ namespace DTXMania
491619 string pathパネル本体 = CSkin.Path(@"Graphics\ScreenSelect popup auto settings.png");
492620 if (File.Exists(pathパネル本体))
493621 {
622+ if (this.txパネル本体 != null)
623+ {
624+ this.txパネル本体.Dispose();
625+ }
494626 this.txパネル本体 = TextureFactory.tテクスチャの生成(pathパネル本体, true);
495627 }
496628 base.OnManagedリソースの作成();